added toJSON to create a persistable Mongo object