little bit refactored apitestcase class