Made error responses much more logical.
Updated to reflect the changes made to the API in 2e2ca028da049f80cbef890d2b17366ae8f38700.
Handles errors more efficiently
Vastly improved how errors were handled over AJAX.