Addd Json Output for controllers. Added Test.