Added correct binding and exeption handling to server.