Modified the Flask control flow diagram