create sum api method