finished converting api request to a script