Updated invalid/valid_data_list

- As per bz 1083471, now UI automatically stripped the leading and trailing white spaces in name, so such data is now valid and moved from `invalid_data_list` to `valid_data_list`
- directly returning the data list instead of via variables
- updated `escape_search` fn to strip the string that includes leading and trailing strings otherwise search would fail and test too.