changed the error reporting

I changed the error reporting so that it's a JSON-hash containing the error-message from the raised exception.
The previous version was not working in Rails 3.2.11
Merge pull request #1 from ansjob/patch-1

changed the error reporting