API test refactoring tests