WIP restful: addition of pagination

I will change that also.