RR: split function to parse json and csv in seperate functions
RR: remove unnecessary tempdir