api: minor style issue
api: use decoder instead of unmarshal

Bit cleaner, though we don't have the body bytes available then.