Whoever you protect from the terrorist attack will be the group who you get an ending with.
So, as long as you do not deal with the haunted mall, or at least do not try and clear out all of the enemies within, you will get an ending.
Wait,Are you saying that I can only get the ending with whoever I protect from the terrorist attack? Then does that mean it is meaningless to go through the other two side quest in one playthrough?
No. You can still get Level 2-3 elemental spells from said side quests.
Not to mention see a change in daily events.