Refactor /users endpoint