fix credential api