Better error handling support

First commit adds support for the backend to answer with some JSON and be able to use it from the client

The second commit I didn't really want to pull request it, but I'm unable to get rid of it (this is my first pr :). It caps the length limit of an input text to 255 which is a nice default value often used in databases, and some sort of standard in my applications, but I could understand people not really needing it :)