Getting data on /documents
Factored out the creation of a @documents array into a method.