In front-end side, our implementation when fetching a data from the server is that the response data structure should be consistent.
e.g when the response has data and in the form of an object structure
{
"total": 22,
"per_page": "1000",
"current_page": 1,
"last_page": 1,
"next_page_url": null,