finish json serialization