Added output of error message if returned error from API