restful: addition of `validate` function in RestfulPagination

you could raise `InvalidPageError` directly here.