added a pagination threshold, so that  when there are fewer than this number of parent items, we return them all and do not paginate