adding pagination to api calls

This PR is to enable pagination for a set of rest API calls that support pagination. We have noticed that certain cf requests currently do not handle the case where the api returns multiple pages of results but they currently assume a single page of results. This problem is addressed in this PR.