finished rest/socket stuff