Fix paging for Messages API