User profile Api and refactoring