fixed user api
Cleanup code