resetQuota and refactor
diff --git a/.idea/apidQuota.iml b/.idea/apidQuota.iml
new file mode 100644
index 0000000..ab5c759
--- /dev/null
+++ b/.idea/apidQuota.iml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="PROVIDED" name="Go SDK" level="project" />
+    <orderEntry type="library" name="GOPATH &lt;apidQuota&gt;" level="project" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/.idea/libraries/GOPATH__apidQuota_.xml b/.idea/libraries/GOPATH__apidQuota_.xml
new file mode 100644
index 0000000..d1c3206
--- /dev/null
+++ b/.idea/libraries/GOPATH__apidQuota_.xml
@@ -0,0 +1,21 @@
+<component name="libraryTable">
+  <library name="GOPATH &lt;apidQuota&gt;">
+    <CLASSES>
+      <root url="file://$PROJECT_DIR$/../../../tutorial" />
+      <root url="file://$PROJECT_DIR$/../../../golang.org" />
+      <root url="file://$PROJECT_DIR$/../../../gopkg.in" />
+      <root url="file://$PROJECT_DIR$/../../../hello" />
+      <root url="file://$PROJECT_DIR$/../.." />
+    </CLASSES>
+    <SOURCES>
+      <root url="file://$PROJECT_DIR$/../../../tutorial" />
+      <root url="file://$PROJECT_DIR$/../../../golang.org" />
+      <root url="file://$PROJECT_DIR$/../../../gopkg.in" />
+      <root url="file://$PROJECT_DIR$/../../../hello" />
+      <root url="file://$PROJECT_DIR$/../.." />
+    </SOURCES>
+    <excluded>
+      <root url="file://$PROJECT_DIR$" />
+    </excluded>
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/Go_SDK.xml b/.idea/libraries/Go_SDK.xml
new file mode 100644
index 0000000..22c27bf
--- /dev/null
+++ b/.idea/libraries/Go_SDK.xml
@@ -0,0 +1,10 @@
+<component name="libraryTable">
+  <library name="Go SDK">
+    <CLASSES>
+      <root url="file:///usr/local/go/src" />
+    </CLASSES>
+    <SOURCES>
+      <root url="file:///usr/local/go/src" />
+    </SOURCES>
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..7831da4
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/apidQuota.iml" filepath="$PROJECT_DIR$/.idea/apidQuota.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..e53d637
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,746 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="cdd847b5-69d1-4507-93c7-7b30868c4d7a" name="Default" comment="">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/api.go" afterPath="$PROJECT_DIR$/api.go" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/api_test.go" afterPath="$PROJECT_DIR$/api_test.go" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/quotaBucket/quotaBucket.go" afterPath="$PROJECT_DIR$/quotaBucket/quotaBucket.go" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/quotaBucket/quotaBucketType.go" afterPath="$PROJECT_DIR$/quotaBucket/quotaBucketType.go" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go" afterPath="$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/services/counterServiceHelper.go" afterPath="$PROJECT_DIR$/services/counterServiceHelper.go" />
+    </list>
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
+  <component name="FileEditorManager">
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
+      <file leaf-file-name="quotaDescriptorType_test.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="2005">
+              <caret line="258" column="125" lean-forward="false" selection-start-line="258" selection-start-column="119" selection-end-line="258" selection-end-column="125" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="api_test.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/api_test.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="-1965">
+              <caret line="34" column="37" lean-forward="false" selection-start-line="34" selection-start-column="29" selection-end-line="34" selection-end-column="37" />
+              <folding>
+                <element signature="e#24#161#0" expanded="true" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="quotaBucket_suite_test.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket_suite_test.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="225">
+              <caret line="19" column="34" lean-forward="false" selection-start-line="19" selection-start-column="34" selection-end-line="19" selection-end-column="34" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="quotaBucket_test.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket_test.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="-1091">
+              <caret line="57" column="8" lean-forward="false" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="8" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="quotaBucketType_test.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucketType_test.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="0">
+              <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="quotaBucket.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="46">
+              <caret line="301" column="37" lean-forward="true" selection-start-line="301" selection-start-column="37" selection-end-line="301" selection-end-column="37" />
+              <folding>
+                <element signature="e#21#60#0" expanded="true" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="quotaBucketType.go" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucketType.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="193">
+              <caret line="102" column="0" lean-forward="true" selection-start-line="102" selection-start-column="0" selection-end-line="102" selection-end-column="0" />
+              <folding>
+                <element signature="e#21#96#0" expanded="true" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="quotaDescriptorType.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="104">
+              <caret line="25" column="35" lean-forward="false" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="35" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="counterServiceHelper.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/services/counterServiceHelper.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="-663">
+              <caret line="34" column="5" lean-forward="false" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="globalVariables.go" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/globalVariables/globalVariables.go">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="105">
+              <caret line="7" column="19" lean-forward="true" selection-start-line="7" selection-start-column="19" selection-end-line="7" selection-end-column="19" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="FindInProjectRecents">
+    <findStrings>
+      <find>startt</find>
+      <find>func (sQuotaBucket SynchronousQuotaBucketType) resetCount(qBucket *QuotaBucket) error {</find>
+      <find>resetCount</find>
+      <find>resetc</find>
+      <find>resetco</find>
+      <find>resetcou</find>
+      <find>resetcoun</find>
+      <find>reset</find>
+    </findStrings>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go" />
+        <option value="$PROJECT_DIR$/init.go" />
+        <option value="$PROJECT_DIR$/api.go" />
+        <option value="$PROJECT_DIR$/quotaBucket/quotaBucket.go" />
+        <option value="$PROJECT_DIR$/services/counterServiceHelper.go" />
+        <option value="$PROJECT_DIR$/api_test.go" />
+        <option value="$PROJECT_DIR$/quotaBucket/quotaBucketType.go" />
+      </list>
+    </option>
+  </component>
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
+  <component name="JsGulpfileManager">
+    <detection-done>true</detection-done>
+    <sorting>DEFINITION_ORDER</sorting>
+  </component>
+  <component name="ProjectFrameBounds">
+    <option name="y" value="23" />
+    <option name="width" value="1280" />
+    <option name="height" value="712" />
+  </component>
+  <component name="ProjectView">
+    <navigator currentView="ProjectPane" proportions="" version="1">
+      <flattenPackages />
+      <showMembers />
+      <showModules />
+      <showLibraryContents />
+      <hideEmptyPackages />
+      <abbreviatePackageNames />
+      <autoscrollToSource />
+      <autoscrollFromSource />
+      <sortByType />
+      <manualOrder />
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="ProjectPane">
+        <subPane>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="services" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="quotaBucket" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="globalVariables" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="apidQuota" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="constants" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+        </subPane>
+      </pane>
+      <pane id="Scratches" />
+      <pane id="Scope" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="RunManager" selected="Go Test.apidQuota_suite_test.go">
+    <configuration default="false" name="apidQuota_suite_test.go" type="GoTestRunConfiguration" factoryName="Go Test" temporary="true">
+      <module name="apidQuota" />
+      <working_directory value="$PROJECT_DIR$" />
+      <go_parameters value="-i" />
+      <framework value="gotest" />
+      <kind value="FILE" />
+      <directory value="$PROJECT_DIR$" />
+      <filePath value="$PROJECT_DIR$/apidQuota_suite_test.go" />
+      <method />
+    </configuration>
+    <configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
+      <module name="" />
+      <working_directory value="$PROJECT_DIR$" />
+      <go_parameters value="-i" />
+      <filePath value="$PROJECT_DIR$" />
+      <kind value="FILE" />
+      <method />
+    </configuration>
+    <configuration default="true" type="GoRunFileConfiguration" factoryName="Go Single File">
+      <module name="" />
+      <working_directory value="$PROJECT_DIR$" />
+      <filePath value="$PROJECT_DIR$" />
+      <method />
+    </configuration>
+    <configuration default="true" type="GoTestRunConfiguration" factoryName="Go Test">
+      <module name="apidQuota" />
+      <working_directory value="$PROJECT_DIR$/quotaBucket" />
+      <go_parameters value="-i" />
+      <framework value="gotest" />
+      <kind value="FILE" />
+      <directory value="$PROJECT_DIR$" />
+      <filePath value="$PROJECT_DIR$/quotaBucket/quotaBucket_suite_test.go" />
+      <method />
+    </configuration>
+    <configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
+      <node-interpreter value="project" />
+      <working-dir value="" />
+      <envs />
+      <scope-kind value="ALL" />
+      <method />
+    </configuration>
+    <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
+      <config-file value="" />
+      <node-interpreter value="project" />
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
+      <method />
+    </configuration>
+    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
+      <node-interpreter>project</node-interpreter>
+      <node-options />
+      <gulpfile />
+      <tasks />
+      <arguments />
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
+      <command value="run" />
+      <scripts />
+      <node-interpreter value="project" />
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="false" name="quotaBucket_suite_test.go" type="GoTestRunConfiguration" factoryName="Go Test">
+      <module name="apidQuota" />
+      <working_directory value="$PROJECT_DIR$/quotaBucket" />
+      <go_parameters value="-i" />
+      <framework value="gotest" />
+      <kind value="FILE" />
+      <directory value="$PROJECT_DIR$" />
+      <filePath value="$PROJECT_DIR$/quotaBucket/quotaBucket_suite_test.go" />
+      <method />
+    </configuration>
+    <list size="2">
+      <item index="0" class="java.lang.String" itemvalue="Go Test.quotaBucket_suite_test.go" />
+      <item index="1" class="java.lang.String" itemvalue="Go Test.apidQuota_suite_test.go" />
+    </list>
+    <recent_temporary>
+      <list size="1">
+        <item index="0" class="java.lang.String" itemvalue="Go Test.apidQuota_suite_test.go" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false">
+    <option name="remove_strategy" value="false" />
+  </component>
+  <component name="TestHistory">
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 09h 59m 43s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 09h 59m 53s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 11m 09s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 11m 38s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 12m 57s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 13m 57s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 14m 26s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 14m 44s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 15m 45s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+    <history-entry file="apidQuota_suite_test_go - 2017.04.13 at 10h 16m 04s.xml">
+      <configuration name="apidQuota_suite_test.go" configurationId="GoTestRunConfiguration" />
+    </history-entry>
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="0" y="23" width="1280" height="712" extended-state="6" />
+    <layout>
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2374798" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
+      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2962963" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Version Control" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3164983" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+    </layout>
+    <layout-to-restore>
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.52693605" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32996634" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3164983" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2374798" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+    </layout-to-restore>
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="processedProjectFiles" value="true" />
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager>
+      <breakpoints>
+        <line-breakpoint enabled="true" type="DlvLineBreakpoint">
+          <url>file://$PROJECT_DIR$/api_test.go</url>
+          <line>131</line>
+        </line-breakpoint>
+      </breakpoints>
+      <option name="time" value="1" />
+    </breakpoint-manager>
+    <watches-manager />
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="3765">
+          <caret line="258" column="125" lean-forward="false" selection-start-line="258" selection-start-column="119" selection-end-line="258" selection-end-column="125" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/apiUtil.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1410">
+          <caret line="98" column="0" lean-forward="false" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/api_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1275">
+          <caret line="85" column="17" lean-forward="false" selection-start-line="85" selection-start-column="17" selection-end-line="85" selection-end-column="17" />
+          <folding>
+            <element signature="e#24#161#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/pluginData.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="0">
+          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/init.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="405">
+          <caret line="32" column="92" lean-forward="false" selection-start-line="32" selection-start-column="92" selection-end-line="32" selection-end-column="92" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="4410">
+          <caret line="298" column="22" lean-forward="false" selection-start-line="298" selection-start-column="22" selection-end-line="298" selection-end-column="22" />
+          <folding>
+            <element signature="e#21#60#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucketType.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="930">
+          <caret line="67" column="75" lean-forward="false" selection-start-line="67" selection-start-column="75" selection-end-line="67" selection-end-column="75" />
+          <folding>
+            <element signature="e#21#96#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="765">
+          <caret line="55" column="51" lean-forward="false" selection-start-line="55" selection-start-column="51" selection-end-line="55" selection-end-column="51" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/services/counterServiceHelper.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1335">
+          <caret line="100" column="9" lean-forward="false" selection-start-line="100" selection-start-column="9" selection-end-line="100" selection-end-column="9" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/api.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="540">
+          <caret line="45" column="51" lean-forward="false" selection-start-line="45" selection-start-column="32" selection-end-line="45" selection-end-column="51" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="0">
+          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/apiUtil.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1470">
+          <caret line="98" column="0" lean-forward="false" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/api_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1275">
+          <caret line="85" column="17" lean-forward="true" selection-start-line="85" selection-start-column="17" selection-end-line="85" selection-end-column="17" />
+          <folding>
+            <element signature="e#24#161#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/pluginData.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="0">
+          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/init.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="405">
+          <caret line="32" column="92" lean-forward="false" selection-start-line="32" selection-start-column="92" selection-end-line="32" selection-end-column="92" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="4485">
+          <caret line="299" column="0" lean-forward="false" selection-start-line="299" selection-start-column="0" selection-end-line="299" selection-end-column="0" />
+          <folding>
+            <element signature="e#21#60#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucketType.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="930">
+          <caret line="67" column="75" lean-forward="true" selection-start-line="67" selection-start-column="75" selection-end-line="67" selection-end-column="75" />
+          <folding>
+            <element signature="e#21#96#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="765">
+          <caret line="55" column="51" lean-forward="false" selection-start-line="55" selection-start-column="51" selection-end-line="55" selection-end-column="51" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/services/counterServiceHelper.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1335">
+          <caret line="100" column="9" lean-forward="true" selection-start-line="100" selection-start-column="9" selection-end-line="100" selection-end-column="9" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/api.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="540">
+          <caret line="45" column="37" lean-forward="true" selection-start-line="45" selection-start-column="37" selection-end-line="45" selection-end-column="37" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/pluginData.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="0">
+          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/init.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="190">
+          <caret line="32" column="92" lean-forward="false" selection-start-line="32" selection-start-column="92" selection-end-line="32" selection-end-column="92" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/apiUtil.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="340">
+          <caret line="98" column="0" lean-forward="false" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/api.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-440">
+          <caret line="45" column="51" lean-forward="false" selection-start-line="45" selection-start-column="32" selection-end-line="45" selection-end-column="51" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="2005">
+          <caret line="258" column="125" lean-forward="false" selection-start-line="258" selection-start-column="119" selection-end-line="258" selection-end-column="125" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/globalVariables/globalVariables.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="105">
+          <caret line="7" column="19" lean-forward="true" selection-start-line="7" selection-start-column="19" selection-end-line="7" selection-end-column="19" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/services/counterServiceHelper.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-663">
+          <caret line="34" column="5" lean-forward="false" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="46">
+          <caret line="301" column="37" lean-forward="true" selection-start-line="301" selection-start-column="37" selection-end-line="301" selection-end-column="37" />
+          <folding>
+            <element signature="e#21#60#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket_suite_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="225">
+          <caret line="19" column="34" lean-forward="false" selection-start-line="19" selection-start-column="34" selection-end-line="19" selection-end-column="34" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/api_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-1965">
+          <caret line="34" column="37" lean-forward="false" selection-start-line="34" selection-start-column="29" selection-end-line="34" selection-end-column="37" />
+          <folding>
+            <element signature="e#24#161#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucketType_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="0">
+          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucket_test.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-1091">
+          <caret line="57" column="8" lean-forward="false" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="8" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaDescriptorType.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="104">
+          <caret line="25" column="35" lean-forward="false" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="35" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/quotaBucket/quotaBucketType.go">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="193">
+          <caret line="102" column="0" lean-forward="true" selection-start-line="102" selection-start-column="0" selection-end-line="102" selection-end-column="0" />
+          <folding>
+            <element signature="e#21#96#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+</project>
\ No newline at end of file
diff --git a/api.go b/api.go
index 2ad5103..8da5978 100644
--- a/api.go
+++ b/api.go
@@ -16,6 +16,9 @@
 	quotaBasePath := globalVariables.Config.GetString(constants.ConfigQuotaBasePath)
 	services.API().HandleFunc(quotaBasePath, checkQuotaLimitExceeded).Methods("POST")
 
+	services.API().HandleFunc(quotaBasePath+"/resetQuota",
+		resetAndCheckQuotaLimit).Methods("POST")
+
 }
 
 func checkQuotaLimitExceeded(res http.ResponseWriter, req *http.Request) {
@@ -54,3 +57,38 @@
 	res.Write(respbytes)
 
 }
+
+func resetAndCheckQuotaLimit(res http.ResponseWriter, req *http.Request) {
+	bodyBytes, err := ioutil.ReadAll(req.Body)
+	defer req.Body.Close()
+	if err != nil {
+		util.WriteErrorResponse(http.StatusBadRequest, constants.UnableToParseBody, "unable to read request body: "+err.Error(), res, req)
+		return
+	}
+
+	quotaBucketMap := make(map[string]interface{}, 0)
+	if err := json.Unmarshal(bodyBytes, &quotaBucketMap); err != nil {
+		util.WriteErrorResponse(http.StatusBadRequest, constants.UnMarshalJSONError, "unable to convert request body to an object: "+err.Error(), res, req)
+		return
+	}
+
+	// parse the request body into the QuotaBucket struct
+	qBucket := new(quotaBucket.QuotaBucket)
+	if err = qBucket.FromAPIRequest(quotaBucketMap); err != nil {
+		util.WriteErrorResponse(http.StatusBadRequest, constants.ErrorConvertReqBodyToEntity, err.Error(), res, req)
+		return
+	}
+
+	results, err := qBucket.ResetQuotaLimit()
+	if err != nil {
+		util.WriteErrorResponse(http.StatusBadRequest, constants.ErrorCheckingQuotaLimit, "error retrieving count for the give identifier "+err.Error(), res, req)
+		return
+	}
+
+	respMap := results.ToAPIResponse()
+	respbytes, err := json.Marshal(respMap)
+
+	res.Header().Set("Content-Type", "application/json")
+	res.WriteHeader(http.StatusOK)
+	res.Write(respbytes)
+}
\ No newline at end of file
diff --git a/api_test.go b/api_test.go
index 4bae205..6dfde56 100644
--- a/api_test.go
+++ b/api_test.go
@@ -8,6 +8,7 @@
 	"io/ioutil"
 	"bytes"
 	"time"
+	"github.com/google/uuid"
 )
 
 func init() {
@@ -22,7 +23,7 @@
 const testQuotaAPIURL = "http://localhost:9000/quota"
 
 var _ = Describe("Api Tests", func() {
-	FIt("test Synchronous quota - valid test cases", func() {
+	It("test Synchronous quota - valid test cases", func() {
 		requestData := make(map[string]interface{})
 		requestData["edgeOrgID"] = "testTenant"
 		requestData["id"] = "testID"
@@ -30,7 +31,7 @@
 		requestData["timeUnit"] = "HOUR"
 		requestData["quotaType"] = "CALENDAR"
 		requestData["preciseAtSecondsLevel"] = false
-		requestData["startTime"] = 1489189921
+		requestData["startTime"] = time.Now().UTC().AddDate(0,0,1).Unix()
 		requestData["maxCount"] = 5
 		requestData["bucketType"] = "Synchronous"
 		requestData["weight"] = 2
@@ -56,7 +57,7 @@
 			Fail("wrong status code: " + res.Status)
 		}
 
-		//valid request - case insensitive - timeUnit, quotaType, bucketType
+		//TestCase1: valid request - case insensitive - timeUnit, quotaType, bucketType
 		requestData["timeUnit"] = "HoUR"
 		requestData["quotaType"] = "cALEndar"
 		requestData["bucketType"] = "syncHRonous"
@@ -76,7 +77,7 @@
 			Fail("wrong status code: " + res.Status)
 		}
 
-		//valid request - startTime not sent in request - optional.
+		//TestCase2: valid request - startTime not sent in request - optional.
 		delete(requestData, "startTime")
 
 		req, err = http.NewRequest("POST", testQuotaAPIURL, ioutil.NopCloser(bytes.NewReader(reqBytes)))
@@ -94,5 +95,91 @@
 			Fail("wrong status code: " + res.Status)
 		}
 
+		//TestCase3: quotaType = "RollingWidow"
+		requestData["quotaType"] = "RollingWindow"
+		requestData["startTime"] = time.Now().UTC().AddDate(0,0,1).Unix()
+		req, err = http.NewRequest("POST", testQuotaAPIURL, ioutil.NopCloser(bytes.NewReader(reqBytes)))
+		if err != nil {
+			Fail("error getting newRequest: " + err.Error())
+		}
+
+		res, err = testhttpClient.Do(req)
+		if err != nil {
+			Fail("error calling the api: " + err.Error())
+		}
+
+		// Check the status code is what we expect.
+		if status := res.StatusCode; status != http.StatusOK {
+			Fail("wrong status code: " + res.Status)
+		}
+
+
 	})
+
+	It("test Synchronous quota - invalidation test cases", func() {
+		requestData := make(map[string]interface{})
+		uuid,err := uuid.NewUUID()
+		if err != nil {
+			Fail("error getting uuid")
+		}
+
+		requestData["edgeOrgID"] = "testTenant"
+		requestData["id"] = "testID" + uuid.String()
+		requestData["interval"] = 1
+		requestData["timeUnit"] = "HOUR"
+		requestData["quotaType"] = "CALENDAR"
+		requestData["preciseAtSecondsLevel"] = false
+		requestData["startTime"] = time.Now().UTC().AddDate(0,0,1).Unix()
+		requestData["maxCount"] = 5
+		requestData["bucketType"] = "Synchronous"
+		requestData["weight"] = 2
+
+		//invalid request body - interval not string
+		requestData["interval"] = "test"
+
+		reqBytes, err := json.Marshal(requestData)
+		if err != nil {
+			Fail("error converting requestBody into bytes: " + err.Error())
+		}
+
+		req, err := http.NewRequest("POST", testQuotaAPIURL, ioutil.NopCloser(bytes.NewReader(reqBytes)))
+		if err != nil {
+			Fail("error getting newRequest: " + err.Error())
+		}
+
+		res, err := testhttpClient.Do(req)
+		if err != nil {
+			Fail("error calling the api: " + err.Error())
+		}
+
+		// Check the status code is what we expect.
+		if status := res.StatusCode; status != http.StatusBadRequest {
+			Fail("wrong status code: " + res.Status)
+		}
+
+		//invalid request - timeUnit invalid
+		requestData["interval"] = 1
+		requestData["timeUnit"] = "invalidTimeUnit"
+		reqBytes, err = json.Marshal(requestData)
+		if err != nil {
+			Fail("error converting requestBody into bytes: " + err.Error())
+		}
+
+		req, err = http.NewRequest("POST", testQuotaAPIURL, ioutil.NopCloser(bytes.NewReader(reqBytes)))
+		if err != nil {
+			Fail("error getting newRequest: " + err.Error())
+		}
+
+		res, err = testhttpClient.Do(req)
+		if err != nil {
+			Fail("error calling the api: " + err.Error())
+		}
+
+		// Check the status code is what we expect.
+		if status := res.StatusCode; status != http.StatusBadRequest {
+			Fail("wrong status code: " + res.Status)
+		}
+
+	})
+
 })
diff --git a/quotaBucket/quotaBucket.go b/quotaBucket/quotaBucket.go
index 546ff10..a2dc84b 100644
--- a/quotaBucket/quotaBucket.go
+++ b/quotaBucket/quotaBucket.go
@@ -2,7 +2,6 @@
 
 import (
 	"errors"
-	"github.com/30x/apidQuota/services"
 	"strings"
 	"time"
 )
@@ -285,58 +284,23 @@
 	return false
 }
 
+func (q *QuotaBucket) ResetQuotaLimit() (*QuotaBucketResults, error) {
+	qBucketHandler, err := GetQuotaBucketHandler(q.BucketType)
+	if err != nil {
+		return nil, errors.New("error getting QuotaBucketType: " + err.Error())
+	}
+	return qBucketHandler.resetQuotaForCurrentPeriod(q)
+
+}
+
 func (q *QuotaBucket) IncrementQuotaLimit() (*QuotaBucketResults, error) {
-	maxCount := q.GetMaxCount()
-	exceededCount := false
-	allowedCount := int64(0)
-	weight := q.GetWeight()
-	period, err := q.GetPeriod()
+
+	qBucketHandler, err := GetQuotaBucketHandler(q.BucketType)
 	if err != nil {
-		return nil, errors.New("error getting period: " + err.Error())
+		return nil, errors.New("error getting QuotaBucketType: " + err.Error())
 	}
+	return qBucketHandler.incrementQuotaCount(q)
 
-	//first retrieve the count from counter service.
-	currentCount, err := services.IncrementAndGetCount(q.GetEdgeOrgID(), q.GetID(), 0, period.GetPeriodStartTime().Unix(), period.GetPeriodEndTime().Unix())
-	if err != nil {
-		return nil, err
-	}
-
-	if period.IsCurrentPeriod(q) {
-		if currentCount < maxCount {
-			allowed := maxCount - currentCount
-			if allowed > weight {
-				if weight != 0 {
-					currentCount, err = services.IncrementAndGetCount(q.GetEdgeOrgID(), q.GetID(), weight, period.GetPeriodStartTime().Unix(), period.GetPeriodEndTime().Unix())
-					if err != nil {
-						return nil, err
-					}
-				}
-				allowedCount = currentCount
-			} else {
-				if weight != 0 {
-
-					exceededCount = true
-				}
-				allowedCount = currentCount + weight
-			}
-		} else {
-
-			exceededCount = true
-			allowedCount = currentCount
-		}
-	}
-
-	results := &QuotaBucketResults{
-		EdgeOrgID:      q.GetEdgeOrgID(),
-		ID:             q.GetID(),
-		exceededTokens: exceededCount,
-		currentTokens:  allowedCount,
-		MaxCount:       maxCount,
-		startedAt:      period.GetPeriodStartTime().Unix(),
-		expiresAt:      period.GetPeriodEndTime().Unix(),
-	}
-
-	return results, nil
 }
 
 func IsValidTimeUnit(timeUnit string) bool {
diff --git a/quotaBucket/quotaBucketType.go b/quotaBucket/quotaBucketType.go
index 1eb051a..dd02914 100644
--- a/quotaBucket/quotaBucketType.go
+++ b/quotaBucket/quotaBucketType.go
@@ -3,10 +3,14 @@
 import (
 	"errors"
 	"strings"
+	"github.com/30x/apidQuota/services"
+	"fmt"
 )
 
 type QuotaBucketType interface {
 	resetCount(bucket *QuotaBucket) error
+	incrementQuotaCount(qBucket *QuotaBucket) (*QuotaBucketResults, error)
+	resetQuotaForCurrentPeriod(qBucket *QuotaBucket) (*QuotaBucketResults, error)
 }
 
 type SynchronousQuotaBucketType struct{}
@@ -15,20 +19,116 @@
 	//do nothing.
 	return nil
 }
+func (sQuotaBucket SynchronousQuotaBucketType) resetQuotaForCurrentPeriod(q *QuotaBucket) (*QuotaBucketResults, error) {
 
-type AsynchronousQuotaBucketType struct{}
+	weight := q.GetWeight()
+	weightToReset := -weight
+	period, err := q.GetPeriod()
+	if err != nil {
+		return nil, errors.New("error getting period: " + err.Error())
+	}
+	currentCount, err := services.IncrementAndGetCount(q.GetEdgeOrgID(), q.GetID(), weightToReset, period.GetPeriodStartTime().Unix(), period.GetPeriodEndTime().Unix())
+	exceededCount := currentCount > q.GetMaxCount()
+	results := &QuotaBucketResults{
+		EdgeOrgID:      q.GetEdgeOrgID(),
+		ID:             q.GetID(),
+		exceededTokens: exceededCount,
+		currentTokens:  currentCount,
+		MaxCount:       q.GetMaxCount(),
+		startedAt:      period.GetPeriodStartTime().Unix(),
+		expiresAt:      period.GetPeriodEndTime().Unix(),
+	}
+	return results, nil
 
-func (sQuotaBucket AsynchronousQuotaBucketType) resetCount(qBucket *QuotaBucket) error {
+}
+
+func (sQuotaBucket SynchronousQuotaBucketType) incrementQuotaCount(q *QuotaBucket) (*QuotaBucketResults, error){
+
+	fmt.Println("increment count for sync")
+	maxCount := q.GetMaxCount()
+	exceededCount := false
+	allowedCount := int64(0)
+	weight := q.GetWeight()
+	period, err := q.GetPeriod()
+	if err != nil {
+		return nil, errors.New("error getting period: " + err.Error())
+	}
+
+	//first retrieve the count from counter service.
+	currentCount, err := services.GetCount(q.GetEdgeOrgID(), q.GetID(), period.GetPeriodStartTime().Unix(), period.GetPeriodEndTime().Unix())
+	if err != nil {
+		return nil, err
+	}
+
+	if period.IsCurrentPeriod(q) {
+		if currentCount < maxCount {
+			allowed := maxCount - currentCount
+			if allowed > weight {
+				if weight != 0 {
+					currentCount, err = services.IncrementAndGetCount(q.GetEdgeOrgID(), q.GetID(), weight, period.GetPeriodStartTime().Unix(), period.GetPeriodEndTime().Unix())
+					if err != nil {
+						return nil, err
+					}
+				}
+				allowedCount = currentCount
+			} else {
+				if weight != 0 {
+
+					exceededCount = true
+				}
+				allowedCount = currentCount + weight
+			}
+		} else {
+
+			exceededCount = true
+			allowedCount = currentCount
+		}
+	}
+
+	results := &QuotaBucketResults{
+		EdgeOrgID:      q.GetEdgeOrgID(),
+		ID:             q.GetID(),
+		exceededTokens: exceededCount,
+		currentTokens:  allowedCount,
+		MaxCount:       maxCount,
+		startedAt:      period.GetPeriodStartTime().Unix(),
+		expiresAt:      period.GetPeriodEndTime().Unix(),
+	}
+
+	return results, nil
+}
+
+type AsynchronousQuotaBucketType struct{
+	initialized bool
+
+
+}
+
+func (quotaBucketType AsynchronousQuotaBucketType) resetCount(qBucket *QuotaBucket) error {
 	//yet to implement
 	return nil
 }
 
+func (quotaBucketType AsynchronousQuotaBucketType) incrementQuotaCount(qBucket *QuotaBucket) (*QuotaBucketResults, error) {
+	return nil, nil
+}
+
+func (quotaBucketType AsynchronousQuotaBucketType) resetQuotaForCurrentPeriod(q *QuotaBucket) (*QuotaBucketResults, error) {
+	return nil,nil
+}
+
 type NonDistributedQuotaBucketType struct{}
 
 func (sQuotaBucket NonDistributedQuotaBucketType) resetCount(qBucket *QuotaBucket) error {
 	//yet to implement
 	return nil
 }
+func (sQuotaBucket NonDistributedQuotaBucketType) incrementQuotaCount(qBucket *QuotaBucket) (*QuotaBucketResults, error) {
+	return nil, nil
+}
+func (sQuotaBucket NonDistributedQuotaBucketType) resetQuotaForCurrentPeriod(q *QuotaBucket) (*QuotaBucketResults, error) {
+	return nil,nil
+}
 
 func GetQuotaBucketHandler(qBucket string) (QuotaBucketType, error) {
 	var quotaBucketType QuotaBucketType
diff --git a/quotaBucket/quotaDescriptorType_test.go b/quotaBucket/quotaDescriptorType_test.go
index 30c7c68..bceac12 100644
--- a/quotaBucket/quotaDescriptorType_test.go
+++ b/quotaBucket/quotaDescriptorType_test.go
@@ -27,7 +27,7 @@
 	})
 
 	It("test invalid Type descriptor", func() {
-		_, err := GetQuotaDescriptorTypeHandler("invalidDescriptorType")
+		_, err := GetQuotaDescriptorTypeHandler("invalxidDescriptorType")
 		Expect(err).To(HaveOccurred())
 		if !strings.Contains(err.Error(), InvalidQuotaDescriptorType) {
 			Fail("Excepted error to contain: " + InvalidQuotaDescriptorType + " but got: " + err.Error())
diff --git a/services/counterServiceHelper.go b/services/counterServiceHelper.go
index d0de935..d689fc8 100644
--- a/services/counterServiceHelper.go
+++ b/services/counterServiceHelper.go
@@ -26,7 +26,14 @@
 	Timeout: time.Duration(60 * time.Second),
 }
 
+func GetCount(orgID string, quotaKey string, startTimeInt int64, endTimeInt int64) (int64, error) {
+
+	return IncrementAndGetCount(orgID, quotaKey,0,startTimeInt,endTimeInt)
+}
+
+
 func IncrementAndGetCount(orgID string, quotaKey string, count int64, startTimeInt int64, endTimeInt int64) (int64, error) {
+	fmt.Println("calling counter service")
 	headers := http.Header{}
 	headers.Set("Accept", "application/json")
 	headers.Set("Content-Type", "application/json")