Ported pagination functionality from Napa pull request

@jdoconnor