parse folder structure to json