Add pagination for documents.
Correctly parse page parameter as int.