Calculate the number of pages correctly
Merge pull request #392 from Collaborne/rest-action-pages-calc

Calculate the number of pages correctly