Fix broken tests in api.