refac api