Pulled all API calls out into a module