How to grab variable from one API and add it to the endpoint of another api so it is called many times?