added Flask functionality