Add afterEach hooks to api tests