Serverside paginate on Confluence macro with table


I have created an Confluence Macro displaying an table with information from an external system.

It works great when the nr of entries in the external system is around 50 but when it is larger numbers I get an error due to the amount of data. How should I implement paging in the Confluence table to make it load new rows on demand? The documentaiton only mentions how to do this in the client not how to pass data from the client to the backend.