changed Server and group_update to use context managers