pub fn validate(params: String) -> Result<(), JsError>