made cc api code catch errors