Energy management in microgrids is a highly researched topic especially after the impact of increased renewable energy penetration. At PEMSES, we develop a novel hierarchical Multi-Agent System (MAS) based controller for Energy Management in microgrids. The proposed control architecture will provide faster response and enhanced resiliency even during controller faults. We test the robustness of the controller using real-time simulation tools. We are also working towards electric vehicle integration to grid.