refactor apis integration test.