title: NodeJS - loop with nested API calls
body: <p>Hello I'm new to NodeJs and am trying to work out the best way to get this chain of events working. I have to do two API calls get all the information I need. The first API call is just a list of IDs, then the second API call I pass the ID to get the rest of the information for each object. </p>
  
  <p>However using the method below, I have no idea when everything is finished. Please can someone help me out.</p>
  
  <pre><code>   function getData() { 
              var options = {
              method: 'GET',
              uri: 'https://api.call1.com',
                  qs: {
                      access_token: _accessToken,
                  }
              };
              request(options).then(function(apires){
                 console.log("complete 1");
                  var obj = JSON.parse(apires);
                  obj.data.forEach(function(entry) {        
                      findMore(entry.id)
                  });
              })
     }
  
  
     function findMore(id) {
              var options = {
              method: 'GET',
              uri: 'https://api.call2.com',
                  qs: {
                      access_token: _accessToken,
                  }
              };
              request(options).then(function(apires){
                 console.log("complete 2");
                  var obj = JSON.parse(apires);
              })
     }
  </code></pre>