Minor refactor to API calls