return json to view and retrieving value in view example