Server almost done

Client is very primitive,lots of work need to be done.