How would you approach optimizing a slow-performing REST API?

Technical