change rest env to flask