Added crud operations for a user. Some refactoring also