The server code. Finished.