moved api check to after login process