validate_param function

Common validation utility for bidux functions (DRY principle)