Add optional err-id to response

@wisq @arthurnn

Add err-id from API response to return value. Make it optional to not break backwards compatibility.

Stupid GitHub UI, accidentally opened the PR to upstream :-)