Fix flask integration