I want to do async call from my getData function to getImage function but i am unable to get return data from getImage().Since the getData() does't wait for the completion of getImage(),as getImage() has further async db calls and therefore getData() always returns undefined.

What is the best way to do this instead doing nested callbacks?

```
var getData  = function(id){  
async.series([            
        function(callback){                    
                  var res = getImages(id);                                                                     
                  callback(null, res);                                           
        }
    ],
  // optional callback
  function(err, results){

     if (err) {                      
         console.log("ERROR : " + err);
      }else 
      {           
              console.log("Result: "+results);              
      }
  });

}

var getImages  = function(id){ 

  async.series([            
        function(callback){ 
              Image.find({id: id }).exec(                    
                  function(err, image) { 
                    if (err) {
                         console.log(err);                                
                         callback(err, 0);
                      }else 
                      {     console.log("Count: "+ image.length);                                                                      
                            callback(null, image);                                              
                      }
              });                         
        }
    ],
  // optional callback
  function(err, results){

     if (err) {                     
         console.log("ERROR : " + err);
      }else 
      {                                 

              return results;          

      }
  });

}

getData(1);

```