update service url and encode id