Added new route for when login fails and created a method to check for errors