Add documentation and error check get_variable_id()