add rating validation and tests