Implemented JSON error output using middleware

Laravel 5 develop has removed the Exception\Handler implementation so the Handler contract doesn't resolve.  This commit refactors the check-authorizaton-params and the error handler into middleware.