Add err id to return value

@wisq @arthurnn 

Add err-id from API response to return value. Make it optional to not break backwards compatibility.