Corrects if condition

Returns 400 for invalid JSON.
Updates App::error to return useful messages.
Merge pull request #305 from LearningLocker/issue-300

Returns 400 for invalid JSON to fix #300.