working on cleaning up the api calls