Test response mime type before parsing json

Before, if a non-json error was sent back, it was not surfaced to the user, but replaced with a JSON `SyntaxError`. This commit wraps any error message in a `ForecastError` and sends it to the error parameter of the callback.