Add support for error response in JSON format. Closes #108, #109

Since #60 is probably too big, I propose to support at least JSON responses with this PR. Also, I do not agree how #92, #108 and #109 are trying to address the issue.

Closes #108, #109.

@toastdriven I think #92 should be fixed properly via #60 or something similar for new XML responses.
I was thinking that this could be a mime-type check but since we're using requests, we could outsource this entirely:

```
try:
    reason = resp.json()
except:
   … treat as HTML …
```