converts controllers to return json