server.py: respond to commands