added memoization to client getFolders