Add basic pagination functionality.