Update UserRestController.php

Code optimization