Cleaning up the api