added support for pagination in GET /posts/ API