Made the URL parsing code more flexible to support more resource ID formats.