Creating and listing all documents from database through GET and POST