@anair13 using counters for this doesn't feel right at all.
Instead it would be great if we can convert this into using `promises`.

Have a look at http://docs.angularjs.org/api/ng/service/$q