Fixes pagesize param was retrieved instead of pageSize

Also, force casting `offset` and `pageSize` parameters to integers.