restful: addition of `validate` function in RestfulPagination

please move the import after line 24 as `from .errors import InvalidPageError`