Add better error messages.

These come from the backend and are passed to the frontend via
JSON responses.