Add serialization to JSON