Refactor reward API