return json in addition to logging it