Organized server.py and made it functional