The last page will have zero records in the data array
What I do is I paginate if I have a cursor and number of records = page limit I paginate the next page.
So if the last page does have 100 records the next page will have zero records. (which is less than the limit I request and I usually request 100)