Handle errors
This MR adds support for handling various errors thrown by cubicweb when interacting with the api.
When catching an error, the api will return an HTTP response with the appropriate response code, and a json body with the name of the error and an explanatory message.