Add log for monitoring.
Split flask app to routes.py
Add connection string detection.
Use model directly.
Fix database connection string error.