convert json to directory