added json and mongo serialization