reverted insights api code