Add function to limit the number of results (pagination)

closes #2