fixed a few bugs on the server

The server is still highy experimental at this point. Not everything is
implemented. ut should be good enough for general testing.
Made the server working alone