move several functions from utils to requests.py