refactoring directory response, adding file response