Clean up the api