validation code uses api