code format, adding controller.py for db work and backend logic