support for trailing slash

This is to add support/backward-compatibility for URI's ending in slash, i.e. /someuri/.