save documents to database
(closes #14 #25)