[bugfix] Fix to Id function result document structure and added a test