escape uri with special characters

* cleanup
* also made sure key-row template renders right when diving into a bucket