To be honest the code is messy🧬 and not good at all.
You have written all in one file and start with 3 classes with single letter names,
then on line 76 start with some Flask.
Then some logging and FalconPy before start with Flask routes.
I don't think anyone when look this code and try to advice some optimizing,have to clean it up first.
With Flask you have full freedom(good and bad)🎭,you have chosen the more bad way not do any project setup at all.
Django gives a more finish Project structure setup,with Flask have to this yourself.
My setup when work with small to medium Flask app is similia to this Organizing a Flask Project Beyond Single File
You have written all in one file and start with 3 classes with single letter names,
then on line 76 start with some Flask.
Then some logging and FalconPy before start with Flask routes.
I don't think anyone when look this code and try to advice some optimizing,have to clean it up first.
With Flask you have full freedom(good and bad)🎭,you have chosen the more bad way not do any project setup at all.
Django gives a more finish Project structure setup,with Flask have to this yourself.
My setup when work with small to medium Flask app is similia to this Organizing a Flask Project Beyond Single File