add api for setx
return error when it occurs in receiving data