cleaning up api calls