diff --git a/persistance/keystone.py b/keystone.py
similarity index 100%
rename from persistance/keystone.py
rename to keystone.py
diff --git a/meta_info.py b/meta_info.py
new file mode 100644
index 0000000..f2a8ee1
--- /dev/null
+++ b/meta_info.py
@@ -0,0 +1 @@
+__author__ = 'gstepanov'
diff --git a/persistance/db_manage.py b/persistance/db_manage.py
index 118fe44..b9435d6 100644
--- a/persistance/db_manage.py
+++ b/persistance/db_manage.py
@@ -6,14 +6,10 @@
 import sys
 
 from os import remove
-
 from web_app.app import db
+from config import DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, basedir
 from migrate.versioning import api
 
-from config import basedir
-from config import DATABASE_URI
-from config import SQLALCHEMY_MIGRATE_REPO
-
 
 ACTIONS = {}
 
@@ -101,4 +97,4 @@
 
 
 if __name__ == '__main__':
-    exit(main(sys.argv[1:]))
\ No newline at end of file
+    exit(main(sys.argv[1:]))
diff --git a/persistance/models.py b/persistance/models.py
index f2b7c35..eb632e4 100644
--- a/persistance/models.py
+++ b/persistance/models.py
@@ -25,6 +25,23 @@
     param_1 = db.Column(db.Text())
     param_2 = db.Column(db.Text())
     param_3 = db.Column(db.Text())
+    param_4 = db.Column(db.Text())
+    param_5 = db.Column(db.Text())
+    param_6 = db.Column(db.Text())
+    param_7 = db.Column(db.Text())
+    param_8 = db.Column(db.Text())
+    param_9 = db.Column(db.Text())
+    param_10 = db.Column(db.Text())
+    param_11 = db.Column(db.Text())
+    param_12 = db.Column(db.Text())
+    param_13 = db.Column(db.Text())
+    param_14 = db.Column(db.Text())
+    param_15 = db.Column(db.Text())
+    param_16 = db.Column(db.Text())
+    param_17 = db.Column(db.Text())
+    param_18 = db.Column(db.Text())
+    param_19 = db.Column(db.Text())
+    param_20 = db.Column(db.Text())
 
     def __repr__(self):
         return self.param_1 + " " + self.param_2 + " " + self.param_3
@@ -46,7 +63,8 @@
     build_id = db.Column(db.Integer, ForeignKey('build.id'))
     lab_id = db.Column(db.Integer, ForeignKey('lab.id'))
     date = db.Column(db.DateTime)
-    param_combination_id = db.Column(db.Integer, ForeignKey('param_combination.id'))
+    param_combination_id = db.Column(db.Integer,
+                                     ForeignKey('param_combination.id'))
     bandwith = db.Column(db.Float)
     meta = db.Column(db.String(4096))
 
diff --git a/persistance/storage_api.py b/persistance/storage_api.py
index a1503d4..7394c6a 100644
--- a/persistance/storage_api.py
+++ b/persistance/storage_api.py
@@ -1,14 +1,13 @@
 import datetime
 import math
-from urlparse import urlparse
-
 from flask import json
-from persistance.keystone import KeystoneAuth
+from meta_info import collect_lab_data, total_lab_info
 from sqlalchemy import sql
 from persistance.models import *
 
 
-#class displays measurement. Moved from storage_api_v_1 to avoid circular imports.
+# class displays measurement. Moved from storage_api_v_1
+# to avoid circular imports.
 class Measurement(object):
     def __init__(self):
         self.build = ""
@@ -36,75 +35,10 @@
     return math.sqrt(sum(map(lambda x: (x - m) ** 2, l)))
 
 
-
-def total_lab_info(data):
-    # <koder>: give 'd' meaningful name
-    d = {}
-    d['nodes_count'] = len(data['nodes'])
-    d['total_memory'] = 0
-    d['total_disk'] = 0
-    d['processor_count'] = 0
-
-    for node in data['nodes']:
-        d['total_memory'] += node['memory']['total']
-        d['processor_count'] += len(node['processors'])
-
-        for disk in node['disks']:
-            d['total_disk'] += disk['size']
-
-    to_gb = lambda x: x / (1024 ** 3)
-    d['total_memory'] = format(to_gb(d['total_memory']), ',d')
-    d['total_disk'] = format(to_gb(d['total_disk']), ',d')
-    return d
-
-
-def collect_lab_data(url, cred):
-    u = urlparse(url)
-    keystone = KeystoneAuth(root_url=url, creds=cred, admin_node_ip=u.hostname)
-    lab_info = keystone.do(method='get', path="/api/nodes")
-    fuel_version = keystone.do(method='get', path="/api/version/")
-
-    nodes = []
-    result = {}
-
-    for node in lab_info:
-        # <koder>: give p,i,d,... vars meaningful names
-        d = {}
-        d['name'] = node['name']
-        p = []
-        i = []
-        disks = []
-        devices = []
-
-        for processor in node['meta']['cpu']['spec']:
-             p.append(processor)
-
-        for iface in node['meta']['interfaces']:
-            i.append(iface)
-
-        m = node['meta']['memory'].copy()
-
-        for disk in node['meta']['disks']:
-            disks.append(disk)
-
-        d['memory'] = m
-        d['disks'] = disks
-        d['devices'] = devices
-        d['interfaces'] = i
-        d['processors'] = p
-
-        nodes.append(d)
-
-    result['nodes'] = nodes
-    # result['name'] = 'Perf-1 Env'
-    result['fuel_version'] = fuel_version['release']
-
-    return result
-
-
 def get_build_info(build_name):
     session = db.session()
-    result = session.query(Result, Build).join(Build).filter(Build.name == build_name).first()
+    result = session.query(Result, Build).join(Build).\
+        filter(Build.name == build_name).first()
     lab = session.query(Lab).filter(Lab.id == result[0].lab_id).first()
     return eval(lab.lab_general_info)
 
@@ -122,11 +56,16 @@
             build[item[0]] = [m, s]
 
 
-#filling Param table with initial parameters.
+# filling Param table with initial parameters.
 def add_io_params(session):
-    param1 = Param(name="operation", type='{"write", "randwrite", "read", "randread"}', descr="type of write operation")
-    param2 = Param(name="sync", type='{"a", "s"}', descr="Write mode synchronous/asynchronous")
-    param3 = Param(name="block size", type='{"1k", "2k", "4k", "8k", "16k", "32k", "64k", "128k", "256k"}')
+    param1 = Param(name="operation", type='{"write", "randwrite", '
+                                          '"read", "randread"}',
+                   descr="type of write operation")
+    param2 = Param(name="sync", type='{"a", "s"}',
+                   descr="Write mode synchronous/asynchronous")
+    param3 = Param(name="block size",
+                   type='{"1k", "2k", "4k", "8k", "16k", '
+                        '"32k", "64k", "128k", "256k"}')
 
     session.add(param1)
     session.add(param2)
@@ -135,27 +74,30 @@
     session.commit()
 
 
-#function which adds particular build to database.
+# function which adds particular build to database.
 def add_build(session, build_id, build_name, build_type, md5):
-    build = Build(type=build_type, build_id=build_id, name=build_name, md5=md5)
+    build = Build(type=build_type, build_id=build_id,
+                  name=build_name, md5=md5)
     session.add(build)
     session.commit()
 
     return build.id
 
 
-#function insert particular result.
+# function insert particular result.
 def insert_results(session, build_id, lab_id, params_combination_id,
                    time=None, bandwith=0.0, meta=""):
-    result = Result(build_id=build_id, lab_id=lab_id, params_combination_id=params_combination_id, time=time,
+    result = Result(build_id=build_id, lab_id=lab_id,
+                    params_combination_id=params_combination_id, time=time,
                     bandwith=bandwith, meta=meta)
     session.add(result)
     session.commit()
 
 
-#function responsible for adding particular params combination to database
+# function responsible for adding particular params combination to database
 def add_param_comb(session, *params):
-    params_names = sorted([s for s in dir(ParamCombination) if s.startswith('param_')])
+    params_names = sorted([s for s in dir(ParamCombination)
+                           if s.startswith('param_')])
     d = zip(params_names, params)
     where = ""
 
@@ -165,20 +107,20 @@
     query = session.query(ParamCombination).filter(where)
     rs = session.execute(query).fetchall()
 
-
     if len(rs) == 0:
         param_comb = ParamCombination()
 
         for p in params_names:
             i = int(p.split('_')[1])
-            param_comb.__setattr__('param_' + str(i), params[i - 1])
 
-            param = session.query(Param).filter(Param.id == i).one()
-            values = eval(param.type)
+            if i - 1 < len(params):
+                param_comb.__setattr__('param_' + str(i), params[i - 1])
+                param = session.query(Param).filter(Param.id == i).one()
+                values = eval(param.type)
 
-            if params[i - 1] not in values:
-                values.add(params[i - 1])
-                param.type = str(values)
+                if params[i - 1] not in values:
+                    values.add(params[i - 1])
+                    param.type = str(values)
 
         session.add(param_comb)
         session.commit()
@@ -187,19 +129,22 @@
         return rs[0][0]
 
 
-def add_lab(session, lab_url, lab_name, ceph_version, fuel_version, data, info):
+def add_lab(session, lab_url, lab_name, ceph_version,
+            fuel_version, data, info):
     result = session.query(Lab).filter(Lab.name == lab_name).all()
 
     if len(result) != 0:
         return result[0].id
     else:
         lab = Lab(name=lab_name, url=lab_url, ceph_version=ceph_version,
-                  fuel_version=fuel_version, lab_general_info=str(data), lab_meta=str(info))
+                  fuel_version=fuel_version, lab_general_info=str(data),
+                  lab_meta=str(info))
         session.add(lab)
         session.commit()
         return lab.id
 
-#function store list of builds in database
+
+# function store list of builds in database
 def add_data(data):
     data = json.loads(data)
     session = db.session()
@@ -212,10 +157,11 @@
                              build_data.pop("type"),
                              build_data.pop("iso_md5"),
                              )
+
         creds = {"username": build_data.pop("username"),
                  "password": build_data.pop("password"),
-                 "tenant_name": build_data.pop("tenant_name")
-        }
+                 "tenant_name": build_data.pop("tenant_name")}
+
         lab_url = build_data.pop("lab_url")
         lab_name = build_data.pop("lab_name")
         ceph_version = build_data.pop("ceph_version")
@@ -223,23 +169,27 @@
         data['name'] = lab_name
         info = total_lab_info(data)
         lab_id = add_lab(session, lab_url=lab_name, lab_name=lab_url,
-                ceph_version=ceph_version, fuel_version=data['fuel_version'], data=data, info=info)
+                         ceph_version=ceph_version,
+                         fuel_version=data['fuel_version'],
+                         data=data, info=info)
 
         date = build_data.pop("date")
         date = datetime.datetime.strptime(date, "%a %b %d %H:%M:%S %Y")
 
         for params, [bw, dev] in build_data.items():
             param_comb_id = add_param_comb(session, *params.split(" "))
-            result = Result(param_combination_id=param_comb_id, build_id=build_id,
-                            bandwith=bw, date=date, lab_id=lab_id)
+            result = Result(param_combination_id=param_comb_id,
+                            build_id=build_id, bandwith=bw,
+                            date=date, lab_id=lab_id)
             session.add(result)
             session.commit()
 
 
-#function loads data by parametres described in *params tuple.
-def load_data(*params):
+# function loads data by parameters described in *params tuple.
+def load_data(lab_id=None, build_id=None, *params):
     session = db.session()
-    params_names = sorted([s for s in dir(ParamCombination) if s.startswith('param_')])
+    params_names = sorted([s for s in dir(ParamCombination)
+                           if s.startswith('param_')])
     d = zip(params_names, params)
     where = ""
 
@@ -251,22 +201,28 @@
 
     ids = [r[0] for r in rs]
 
-    results = session.query(Result).filter(Result.param_combination_id.in_(ids))
-    rs = session.execute(results).fetchall()
+    rs = session.query(Result).\
+        filter(Result.param_combination_id.in_(ids)).all()
 
-    return [r[5] for r in rs]
+    if lab_id is not None:
+        rs = [r for r in rs if r.lab_id == lab_id]
+
+    if build_id is not None:
+        rs = [r for r in rs if r.build_id == build_id]
+
+    return rs
 
 
-#load all builds from database
+# load all builds from database
 def load_all():
     session = db.session()
-    r = session.query(Param).filter(Param.id == 1).all()
-    results = session.query(Result, Build, ParamCombination).join(Build).join(ParamCombination).all()
+    results = session.query(Result, Build, ParamCombination).\
+        join(Build).join(ParamCombination).all()
 
     return results
 
 
-#function collecting all builds from database and filter it by names
+# function collecting all builds from database and filter it by names
 def collect_builds_from_db(*names):
     results = load_all()
     d = {}
@@ -277,7 +233,8 @@
         param_combination_data = item[2]
 
         if build_data.name not in d:
-            d[build_data.name] = [build_data, result_data, param_combination_data]
+            d[build_data.name] = \
+                [build_data, result_data, param_combination_data]
         else:
             d[build_data.name].append(result_data)
             d[build_data.name].append(param_combination_data)
@@ -288,7 +245,7 @@
     return {k: v for k, v in d.items() if k in names}
 
 
-#function creates measurement from data was extracted from database.
+# function creates measurement from data was extracted from database.
 def create_measurement(data):
     build_data = data[0]
 
@@ -323,11 +280,11 @@
     if build.type == 'GA':
         names = [build_name]
     else:
-        res = session.query(Build).filter(Build.type.in_(['GA', 'master', build.type])).all()
+        res = session.query(Build).\
+            filter(Build.type.in_(['GA', 'master', build.type])).all()
         for r in res:
             names.append(r.name)
 
-
     d = collect_builds_from_db()
     d = {k: v for k, v in d.items() if k in names}
     results = {}
@@ -362,10 +319,11 @@
     return res
 
 
-#Processing data from database.
-#List of dicts, where each dict contains build meta info and kev-value measurements.
-#key - param combination.
-#value - [mean, deviation]
+# Processing data from database.
+# List of dicts, where each dict contains build meta
+# info and kev-value measurements.
+# key - param combination.
+# value - [mean, deviation]
 def get_builds_data(names=None):
     d = collect_builds_from_db()
 
@@ -400,20 +358,21 @@
     return output
 
 
-#Function for getting result to display table
+# Function for getting result to display table
 def get_data_for_table(build_name=""):
     session = db.session()
     build = session.query(Build).filter(Build.name == build_name).one()
     names = []
 
-    #Get names of build that we need.
+    # Get names of build that we need.
     if build.type == 'GA':
         names = [build_name]
     else:
-        res = session.query(Build).filter(Build.type.in_(['GA', 'master', build.type])).all()
+        res = session.query(Build).filter(
+            Build.type.in_(['GA', 'master', build.type])).all()
         for r in res:
             names.append(r.name)
-    #get data for particular builds.
+    # get data for particular builds.
     return get_builds_data(names)
 
 
@@ -533,10 +492,5 @@
     }]'
 
     # json_to_db(json_data)
-    # print load_data()
-    add_data(json_data)
-
-    print collect_builds_from_db()
-    print prepare_build_data('6.1 Dev')
-    print builds_list()
-    print get_data_for_table('somedev')
\ No newline at end of file
+    print load_data(1, 2)
+    # add_data(json_data)
diff --git a/web_app/__init__.py b/web_app/__init__.py
index ac0bc15..eed7a8d 100644
--- a/web_app/__init__.py
+++ b/web_app/__init__.py
@@ -5,7 +5,8 @@
 from flask import render_template, url_for, make_response, request
 from report import build_vertical_bar, build_lines_chart
 from web_app import app
-from persistance.storage_api import builds_list, prepare_build_data, get_data_for_table, add_data, get_builds_data, \
+from persistance.storage_api import builds_list, prepare_build_data, \
+    get_data_for_table, add_data, get_builds_data, \
     get_build_info, get_build_detailed_info
 from web_app.app import app
 import os.path
@@ -26,7 +27,8 @@
 app.url_map.add(Rule('/images/<image_name>', endpoint='get_image'))
 app.url_map.add(Rule('/tests/<test_name>', endpoint='render_test'))
 app.url_map.add(Rule('/tests/table/<test_name>/', endpoint='render_table'))
-app.url_map.add(Rule('/api/tests/<test_name>', endpoint='add_test', methods=['POST']))
+app.url_map.add(Rule('/api/tests/<test_name>',
+                     endpoint='add_test', methods=['POST']))
 app.url_map.add(Rule('/api/tests', endpoint='get_all_tests'))
 app.url_map.add(Rule('/api/tests/<test_name>', endpoint='get_test'))
 
@@ -62,10 +64,12 @@
     lines = build_lines_chart(results)
     urls = bars + lines
 
-    urls = [url_for("get_image", image_name=os.path.basename(url)) if not url.startswith('http') else url for url in urls]
+    urls = [url_for("get_image", image_name=os.path.basename(url))
+            if not url.startswith('http') else url for url in urls]
 
     return render_template("test.html", urls=urls,
-                           table_url=url_for('render_table', test_name=test_name),
+                           table_url=url_for('render_table',
+                           test_name=test_name),
                            index_url=url_for('index'), lab_meta=lab_meta)
 
 
@@ -88,14 +92,16 @@
 
             for header in header_keys:
                 if isinstance(test[header], list):
-                    row.append(str(test[header][0]) + unichr(0x00B1) + str(test[header][1]))
+                    row.append(str(test[header][0]) + unichr(0x00B1)
+                               + str(test[header][1]))
                 else:
                     row.append(test[header])
 
             table.append(row)
 
     return render_template("table.html", headers=header_keys, table=table,
-                           back_url=url_for('render_test', test_name=test_name), lab=data)
+                           back_url=url_for('render_test',
+                           test_name=test_name), lab=data)
 
 
 @app.endpoint('add_test')
@@ -120,4 +126,4 @@
     logger = getLogger("logger")
     app.logger.setLevel(INFO)
     app.logger.addHandler(logger)
-    app.run(host='0.0.0.0', debug=True)
\ No newline at end of file
+    app.run(host='0.0.0.0', debug=True)
diff --git a/web_app/app.py b/web_app/app.py
index b67c804..9621bca 100644
--- a/web_app/app.py
+++ b/web_app/app.py
@@ -7,4 +7,3 @@
 db = SQLAlchemy(app)
 app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI
 Bootstrap(app)
-
