fix mysql issues; uncomment flask; remove unused code