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 in something like #60 for new XML responses.