Condensed "get JSON of file listing" fns into one