providers: handle invalid responses

We should handle unexpected responses, such as getting back HTML rather than JSON.