added paging, offset and ppp (posts per page) with tests