Lots of fixes added, more functions added to client/server