implementing the missing JSON and text representations of directory listing