DRYing up the request index.

Still need a way to clean up the setPage function, but this'll do for now.