diff --git a/dataacquisition/api.py b/dataacquisition/api.py
index c91047fb2fd35b09aeac3093784312c608c615c3..34df101dd985751a1396588047f0c0b0d4def006 100644
--- a/dataacquisition/api.py
+++ b/dataacquisition/api.py
@@ -13,6 +13,7 @@ app.config['TESTING'] = False
 
 @app.route('/', methods=['GET'])
 def index():
+    columns = sql.SQL(' * ')
     wheres = sql.SQL('')
     values = ''  # Gets used in cursor.execute()s' second parameter for safety reasons
 
@@ -22,6 +23,16 @@ def index():
         for n in [int(station_id)]:
             values = (*values, n)  # adding n to existing tuple
 
+    if 'years' in request.args:
+        years = request.args['years'].split(',')
+        years_clean = []
+
+        for year in years:
+            years_clean.append('"' + year + '"')
+        years_clean = str(years_clean).replace('[', '').replace(']', '').replace("'", "").replace('\n', '').replace(' ', '')
+
+        columns = sql.SQL('id, ') + sql.SQL(years_clean)
+
     # Just for development
     # if 'country' in request.args:
     #     country = request.args['country']
@@ -30,9 +41,9 @@ def index():
     #         values = (*values, n)  # adding n to existing tuple
 
     query = sql.SQL("SELECT array_to_json(array_agg(row_to_json(t))) from ("
-                    "SELECT * FROM stations WHERE lon IS NOT NULL "
+                    "SELECT {} FROM stations WHERE lon IS NOT NULL "
                     "{} "
-                    ") t;").format(wheres)
+                    ") t;").format(columns, wheres)
 
     with psycopg2.connect(database='temperatures_berteld_morstein', user='postgres', password='postgres', host='localhost', port=5432) as connection:
         with connection.cursor() as cursor: