Change Document serialization method to .to_json_document