Done a lot of the server

Not tested