fixes the edit function on documents.
Finishes all basic CRUD for basic functionality