copied the REST stuff from the Node version so we know what has to be made