[WIP] Refactor errors (follows #52)

Refactor error management when requesting API.

We registered an error handler during the app.config which is called on every promise reject in the API.