refactored user rest controller