Added autologin for api