Added pagination to aggregation method.