Fixed bugs in user API