Added tests for ApiFactory