added HMAC API error handling