Return correct error when deleting a document that does not exist

When deleting a document that does not exist, it now returns a 404, not a 409. I also added a 404 response if deleting a document from a database that does not exist.