prepare math api
update controller to reflect math calculation
maybe there is YAGNI maybe not but here is  implem