Write gson serializers, add sorting direction and paging.