Implemented server.py

Implemented server.py and passes all tests.