check for API error result