refactored apiCall functions to take no aruments