internal/router: do not always resolve ids

When there's a PUT or a POST, we might actually be
creating a new entity, so defer id resolution
in that case so the specific handler can
deal with it.

For POSTs and PUTs to metadata, the id must already
exist, because otherwise there could not be
metadata about it, so we always resolve in that
case.
Same here. Even if it's just formatting, I would suggest that next time we do not make the changes that are not directly related to the suggested PR. And create another PR for them.