diff --git a/make_report.py b/make_report.py
index 96bb622..0dd363d 100644
--- a/make_report.py
+++ b/make_report.py
@@ -19,7 +19,7 @@
         work_sheet = sheet.worksheet(name)
     except WorksheetNotFound:
         work_sheet = sheet.add_worksheet(title=name, rows=ROW_COUNT,
-                                         cols=len(column_names))
+                                         cols=max(40, len(column_names)))
 
         for i in range(1, len(column_names) + 1):
             work_sheet.update_cell(1, i, column_names[i - 1])
@@ -48,18 +48,30 @@
         i += 1
 
 
-def make_report(data):
-    gc = gspread.login(EMAIL, PASSWORD)
+def make_report(email, password, data):
+    gc = gspread.login(email, password)
     sh = gc.open_by_key(DOCUMENT_ID)
 
     work_sheet = get_work_sheet(sh, WORK_SHEET, data.keys())
     append_row(work_sheet, data)
 
 
+def main(file_name, email, password):
+    data = load_data(file_name)
+    make_report(email, password, data)
+
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser()
     parser.add_argument('-n', '--name', help='data file path',
                         default=DEFAULT_FILE_PATH)
+    parser.add_argument('-e', '--email', help='user email',
+                        default="aaa@gmail.com")
+    parser.add_argument('-p', '--password', help='user password',
+                        default="1234")
+    parser.add_argument('-m', '--mode', help='mode type local or global',
+                        default=DEFAULT_FILE_PATH)
     results = parser.parse_args()
-    data = load_data(results.name)
-    make_report(data)
+    print results
+    # main(file_name, email, password)
+
diff --git a/storage_api.py b/storage_api.py
new file mode 100644
index 0000000..2b571dd
--- /dev/null
+++ b/storage_api.py
@@ -0,0 +1,49 @@
+import gspread
+from config import EMAIL, PASSWORD, DOCUMENT_ID, WORK_SHEET
+from make_report import get_work_sheet, append_row
+
+
+class Measurement(object):
+    def __init__(self):
+        self.build = ""
+        self.build_type = 0  # GA/Master/Other
+        self.md5 = ""
+        self.results = {
+            "": (float, float)
+        }
+
+
+class Storage(object):
+
+    def __init__(self, email, password, doc_id, work_sheet_name):
+        self.gc = gspread.login(email, password)
+        self.sh = self.gc.open_by_key(doc_id)
+        self.work_sheet = get_work_sheet(self.sh, work_sheet_name, 40)
+
+    def store(self, data):
+        append_row(self.work_sheet, data)
+
+    def retrieve(self, id):
+        row_number = self.find_by_id(id)
+
+        if row_number != -1:
+            vals = self.work_sheet.row_values(row_number)
+            m = Measurement()
+            m.build = vals["build_id"]
+            del vals["build_id"]
+            m.build_type = vals["type"]
+            del vals["type"]
+            m.md5 = vals["iso_md5"]
+            del vals["iso_md5"]
+            m.results = {k: vals[k] for k in vals.keys()}
+        else:
+            return None
+
+    def find_by_id(self, row_id):
+        for i in range(1, self.work_sheet):
+            if self.work_sheet.cell(i, 1) == row_id:
+                return i
+
+        return -1
+
+
