Added writing Json output to file