work in $q.all to handle batches of requests