use flask to replace bottle