factoring out API calls into utils.py