Adding agentcontroller and some fixes in agentcontrollerfactory