Better failure on non-json responses
Merge branch 'non-json-errors'