restful: pagination improvement

* Improves the pagination mechanism.

* Adds an errors file in restful needed for pagination.

* Refactors restful pagination tests and ensures they pass.

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>