Handle API response errors, i.e. non-JSON response.