Implement json marshalling method for simple serialization