finished rest/socket stuff

fixes #36