compelete the setRating API