Added some exception handling to server
Minor fixes