var itc = require("itunesconnect");
var Report = itc.Report;

var iTunesConnect = {};

iTunesConnect.load = function(args, next) {
  var passedUnit = [];
  var itunes = new itc.Connect(args.email, args.password);

  itunes.request(Report.ranked().time(args.unit.within, 'days'), function(error, result) {
    if (error) {
      next(error, "iTunes connect error.");
    }

    var i, application, unit;

    if (typeof result.length === "undefined") {
      next(result, "iTunes connect error.");
    }

    for (i=0; i<result.length; i++) {
      application = result[i];

      if (application.title == args.unit.title) {
        passedUnit.push(application.units);
      }
    }
  });

  next(false, passedUnit);
}

module.exports = iTunesConnect;

@@ -482,32 +482,46 @@
 nnect error.%22);%0A
+      return;%0A
     %7D%0A%0A    for (
@@ -693,15 +693,11 @@
   %7D%0A
+%0A
   
-%7D);%0A%0A
   ne
@@ -719,16 +719,22 @@
 dUnit);%0A
+  %7D);%0A
 %7D%0A%0Amodul

Fix response timing.