decode json and encode json in schedule_controller