Corrected login behaviour for new user. Changed API for user authentication.