It should be os.path.exists(), not os.exists()
Make sure output is JSON