remove unnecessary error condition check
add tests for logging in and fix discovered bug where users could be logged in with wrong password using API routes