pagination for rest templates