add json list of files to resposne
refactor