WIP restful: addition of pagination

I will remove the one in line 235