I am glad they announced a fourth season already, otherwise I would be pretty worried about this show's future. Ratings are down, and they're shifting it around in the schedule.
The ratings were still above average for the network and apparently it does great on streaming and internationally. That, plus critical acclaim, plus NBC not wanting to endanger their relationship with Schur means it was never really in danger.