Fix insertData and getAllDocuments methods