Add sql request tracking middleware + optimize teams api calls