Partial server code, nowhere near working.