Changed default output format to JSON
Throws exception on error from API
Added unit tests for ApiService