changes to login error checking and API