change id pkey to url and associated methods