Fix invoke API error paths
update based on code review, add test case for no content type headers
Merge pull request #234 from phvannor/dev

InvokeAPI Error Logic for C# and JS SDKs