Added ConvertToJSON function to app.py