Fix a trailing slash bug for `RestController`s that have a `_lookup` method.

Change-Id: Ibd025fc52d37f58644de23cf283afd8d4d55e2d1
Closes-Bug: #1280003