Method to add new document to database