updated python scripts for Flask