Fix parse error and respond to client

The client would hang there if the server encountered an error (no response, 404, parseError).
Now the server rejects the promise, responds to the client with 500.
The client intercepts this error, alerts a message and redirects to '/'.