Fix for when no pagaination options

When no perPage option was passed in a query param or options.pagination was undefined then an error occurred because the perPage was being looked for an undefined object.

Fix is to use a ternary on options.pagination to account for when that property is undefined