Updated user controller to return json of invalid request for index rather than redirect