writing function to update server status