added threads on flask requests