stop and restart server functions