Removes duplicated code in query_tables_api
Removes duplicated code in query_tables_api

UCL-ShippingGroup/Windshaft-cartodb,manueltimita/Windshaft-cartodb,CartoDB/Windshaft-cartodb,manueltimita/Windshaft-cartodb,UCL-ShippingGroup/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,UCL-ShippingGroup/Windshaft-cartodb,manueltimita/Windshaft-cartodb