moving the api call in each function to a new function that will make it cleaner once I start adding parameters to the api call