add test + implement delete on a document id and fix some issues