Fix bugs in api response