Fix pagination in API search calls

/cc @matthew-andrews