Add profiling to API calls