restification, cleanup, flask cookie