working on converting api request into a script