update json2csv module to handle nested objects. Added more error handling.