Improve test coverage for ApiBase.php