Update ServiceCode.pys

Changed logic for parsing id out of the url. A trailing slash would mess up the old code, but the new code should work whether the trailing slash is there or not.