updated coupons api and added test cases for it