Added implementation of im.open, im.close and groups.open