refactored logic to server.py