added json serialization and desierialization