added JSON serialization and deserialization