merge flask and controller