Changed controller to respond with json