write json data to file given by cmd line argument (or default value)