To single line.
Now throws Exceptions on error.

Captures those exceptions and displays appropriate
messages for the interface (an alert, JSON response).

This increases requirements.