Electric vehicles (EVs) are widely regarded as valuable assets in the smart grid as distributed energy resources in addition to their primary transportation function. However, connecting EVs to the distribution network and recharging the EV batteries without any control may overload the transformers and cables during peak hours when the penetration of EVs is relatively high. In this study, a two level hierarchical control method for integrating EVs into the distribution network is proposed to coordinate the self-interests and operational constraints of two actors, the EV owner and Distribution system operator (DSO), facilitated by the introduction of the fleet operator (FO) and the grid capacity market operator (CMO). Unlike the typical hierarchical control system where the upper level controller commands the low level unit to execute the actions, in this study, market based control are applied both in the upper and low level of the hierarchical system. Specifically, in the upper level of the hierarchy, distribution system operator uses market based control to coordinate the fleet operator׳s power schedule. In the low level of the hierarchy, the fleet operator use market based control to allocate the charging power to the individual EVs, by using market based control, the proposed method considers the flexibility of EVs through the presence of the response-weighting factor to the shadow price sent out by the FO. Furthermore, to fully demonstrate the coordination behavior of the proposed control strategy, we built a multi-agent system (MAS) that is based on the co-simulation environment of JACK, Matlab and Simulink. A use case of the MAS and the results of running the system are presented to intuitively illustrate the effectiveness of the proposed solutions.