how twisted and flask work together