Improve test coverage for ApiLogin.php