Refactored APITestCase