Now works correctly, and added a config file so I don't have to expose the api key and auth token