added tests to api class