What's Up With the Ending?
It's a happy one, in case you were worried.
Sure, Manhattan has been junked and there's going to be a staggering clean-up bill (check out Marvel's TV shows Daredevil and the upcoming Damage Control to see how that's going), but the gang pretty much stopped an alien invasion in is tracks and kept the casualties to a minimum.
As Nick Fury would say, "I'd say they've earned a leave of absence."
But we're guessing you didn't expect a downer of an ending. With a few exceptions (Dark Knight, we're looking at you), superhero movies are all about settling things happily and making sure that none of the main cast has been offed. The name of the game here is sequel.
And the ending also includes a pair of post-credits cookies: one featuring a scary purple guy (who turns out to be an intergalactic nihilist named Thanos) and a second one showing the exhausted team enjoying some tasty shawarma after a job well done. The last one's just a bit of fun—a reminder not to take it all too seriously—but the first one is intended to establish a more formal link to upcoming movies in the Marvel Cinematic Universe. (Namely Avengers Infinity War, where Thanos shows up.)
This has become part of a long-standing tradition with the Marvel Universe, and as we mentioned elsewhere, it's actually where The Avengers itself got started: as a post-credits cookie in the original Iron Man.
Similar set-ups take place in the first Thor and first Captain America movie, both intended to get us ready for this one. But with the Marvel Universe a continuing concern—hey, it may outlive us all the way things are going—The Avengers was more than willing to pay it forward.