Fix endpoint template

That `encode {}` call is raising because `{}` on that context is passed as a block, not an empty hash.

Did a first attempt at testing this whole thing there, any feedback is welcome!
Awesome work @pedro!!! This is something that was sorely needed.