Also sort keys when creating series_list. So do not keep order from the xml file. The order conveys just more info on the data.
start to refactor query_rest. Buggy.