I think we can avoid this test hook by just patching the class with a function that remembers the API creation and then returns an api object?