Added profiling to each API endpoint.