Get correct error message from API response.