clean up setup/teardown in API