Added functionality to getAll documents from the rest api