How would you optimize a slow-running API endpoint that processes large geospatial datasets for Syngenta Digital?