Added a backend login() function