handling error from API properly (API does not throw them if not a bug)