Updated to reflect the Flask architecture