changes and fixes in ApiTest.java