[863746] Error handling plus error codes for API logic
Merge pull request #19 from ksedge/b863746

[Bug 863746] Optimize error handling and HTTP error codes in API calls