Catch errors when JSON is not returned.

I noticed this when I had a copy/paste mistake in the API key.