Refactor error messages.
Rewrite #1.
Rewrite #2.
Rewrite #3.
Fix error response for remote procedure calls.
Rewrite #4.