finalized error handling for login/signup routes