Fix server error messages

Fixing server error messages to return the correct message id (if available).

cc @countrodrigo