a bit of refactoring of WebServiceAPIUnitTest.