decode api response