Guard against non-json responses -> make sure to still return something useful in the error message when this happens.
Merge pull request #35 from chrishic/non-json-errors

Guard against non-json error responses