Add function to limit the number of results (pagination)

Fixes #2