change the output json format

Change from top-level-array based to top-level-object based json