Describe a time you had to optimize a slow-performing API endpoint that was critical to the user experience.