Help writing JS code for pagination

Yes, I'd like to be able to loop through all pages and return all results. I don't know enough about server-side pagination to determine if that's what I need here...

Here is my API request
image

Here is the response
image

Here is where the status code shows up:
image