user api refoctoring