Added sorting in service implementation