Another attempt to make python script return correct json object