use JSON.serialize to handle issues with mongo document id's conversion to JSON