add paginated json_response function

Add a paginated `json_response` function for easy pagination in php controllers.

cc @cmerrick @nscott @natevecc @bpiel