fix /profile service and refactor unit tests