restful: addition of `validate` function in RestfulPagination

Please move the import at beginning of the file and add docstring. Thanks