Adding validation for the $value variable in text  text area get_value_for_api function

Signed-off-by: Elliot Condon <e@elliotcondon.com>