Refactored API tests.