I really don't like writing pagers.
Whether for blog posts or API results, I'll jump over the moon to avoid writing a pager. But why? For one thin...
For further actions, you may consider blocking this person and/or reporting abuse
For calculating
numOfPages, just use something likeMath.ceil(totalItems/itemsPerPage).