How to pull data from web APIs with pagination

There is a simpler way to query API with pagination. An updated (and simplified) example is published in a new thread:

https://community.easymorph.com/t/api-pagination-next-page/5076/4?u=dgudkov