Convert a list in python to json