Tidy up of the server controller and fixed it