Refs #133 - Catch 501 and 404 exceptions thrown by Silex.

Format all responses in JSON.
Refs #133 - Fix PHPCS error and clean up code.
Merge pull request #133 from synapsestudios/feature/133-format-json-responses

Return JSON for 404, 403, 401, 501, and 500 responses