Implemented JSON error handler 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.