Error check api response and change output accordingly.