Fixed small behavior issues when API returned an error.
Merge pull request #6 from chead/develop

Fixed small behavior issues when API returned an error.