how to convert array of dictionary to json in python