add json function in pagination object