diff --git a/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java b/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java
index ab6b444..f7d6210 100644
--- a/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java
+++ b/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java
@@ -15,6 +15,7 @@
  */
 package org.onosproject.net.meter;
 
+import com.google.common.base.Objects;
 import com.google.common.collect.ImmutableSet;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.DeviceId;
@@ -151,6 +152,26 @@
                 .add("bands", bands).toString();
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        DefaultMeter that = (DefaultMeter) o;
+        return Objects.equal(id, that.id) &&
+                Objects.equal(appId, that.appId) &&
+                Objects.equal(unit, that.unit) &&
+                Objects.equal(deviceId, that.deviceId);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(id, appId, unit, deviceId);
+    }
+
     public static final class Builder implements Meter.Builder {
 
         private MeterId id;
diff --git a/core/api/src/main/java/org/onosproject/net/meter/DefaultMeterRequest.java b/core/api/src/main/java/org/onosproject/net/meter/DefaultMeterRequest.java
new file mode 100644
index 0000000..94cada4
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/meter/DefaultMeterRequest.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.net.meter;
+
+import com.google.common.collect.ImmutableSet;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.DeviceId;
+
+import java.util.Collection;
+import java.util.Optional;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A default implementation of a meter.
+ */
+public final class DefaultMeterRequest implements MeterRequest {
+
+
+
+    private final ApplicationId appId;
+    private final Meter.Unit unit;
+    private final boolean burst;
+    private final Collection<Band> bands;
+    private final DeviceId deviceId;
+    private final Optional<MeterContext> context;
+    private final Type op;
+
+    private DefaultMeterRequest(DeviceId deviceId, ApplicationId appId,
+                                Meter.Unit unit, boolean burst,
+                                Collection<Band> bands, MeterContext context, Type op) {
+        this.deviceId = deviceId;
+        this.appId = appId;
+        this.unit = unit;
+        this.burst = burst;
+        this.bands = bands;
+        this.context = Optional.ofNullable(context);
+        this.op = op;
+    }
+
+    @Override
+    public DeviceId deviceId() {
+        return deviceId;
+    }
+
+    @Override
+    public ApplicationId appId() {
+        return appId;
+    }
+
+    @Override
+    public Meter.Unit unit() {
+        return unit;
+    }
+
+    @Override
+    public boolean isBurst() {
+        return burst;
+    }
+
+    @Override
+    public Collection<Band> bands() {
+        return bands;
+    }
+
+    @Override
+    public Optional<MeterContext> context() {
+        return context;
+    }
+
+
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("device", deviceId)
+                .add("appId", appId.name())
+                .add("unit", unit)
+                .add("isBurst", burst)
+                .add("bands", bands).toString();
+    }
+
+    public static final class Builder implements MeterRequest.Builder {
+
+        private ApplicationId appId;
+        private Meter.Unit unit = Meter.Unit.KB_PER_SEC;
+        private boolean burst = false;
+        private Collection<Band> bands;
+        private DeviceId deviceId;
+        private MeterContext context;
+
+
+        @Override
+        public MeterRequest.Builder forDevice(DeviceId deviceId) {
+            this.deviceId = deviceId;
+            return this;
+        }
+
+        @Override
+        public MeterRequest.Builder fromApp(ApplicationId appId) {
+            this.appId = appId;
+            return this;
+        }
+
+        @Override
+        public MeterRequest.Builder  withUnit(Meter.Unit unit) {
+            this.unit = unit;
+            return this;
+        }
+
+        @Override
+        public MeterRequest.Builder  burst() {
+            this.burst = true;
+            return this;
+        }
+
+        @Override
+        public MeterRequest.Builder  withBands(Collection<Band> bands) {
+            this.bands = ImmutableSet.copyOf(bands);
+            return this;
+        }
+
+        @Override
+        public MeterRequest.Builder withContext(MeterContext context) {
+            this.context = context;
+            return this;
+        }
+
+        @Override
+        public MeterRequest add() {
+            validate();
+            return new DefaultMeterRequest(deviceId, appId, unit, burst, bands,
+                                           context, Type.ADD);
+        }
+
+        @Override
+        public MeterRequest remove() {
+            validate();
+            return new DefaultMeterRequest(deviceId, appId, unit, burst, bands,
+                                           context, Type.REMOVE);
+        }
+
+        private void validate() {
+            checkNotNull(deviceId, "Must specify a device");
+            checkNotNull(bands, "Must have bands.");
+            checkArgument(bands.size() > 0, "Must have at least one band.");
+            checkNotNull(appId, "Must have an application id");
+        }
+
+
+    }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/meter/Meter.java b/core/api/src/main/java/org/onosproject/net/meter/Meter.java
index 8ea04b0..98ebc35 100644
--- a/core/api/src/main/java/org/onosproject/net/meter/Meter.java
+++ b/core/api/src/main/java/org/onosproject/net/meter/Meter.java
@@ -130,7 +130,7 @@
         /**
          * Assigns the id to this meter.
          *
-         * @param id a meter id
+         * @param id a e
          * @return this
          */
         Builder withId(MeterId id);
diff --git a/core/api/src/main/java/org/onosproject/net/meter/MeterContext.java b/core/api/src/main/java/org/onosproject/net/meter/MeterContext.java
index 005c41c..574bdca 100644
--- a/core/api/src/main/java/org/onosproject/net/meter/MeterContext.java
+++ b/core/api/src/main/java/org/onosproject/net/meter/MeterContext.java
@@ -26,7 +26,7 @@
      *
      * @param op a meter
      */
-    default void onSuccess(Meter op) {}
+    default void onSuccess(MeterRequest op) {}
 
     /**
      * Invoked when error is encountered while installing a meter.
@@ -34,5 +34,5 @@
      * @param op a meter
      * @param reason the reason why it failed
      */
-    default void onError(Meter op, MeterFailReason reason) {}
+    default void onError(MeterRequest op, MeterFailReason reason) {}
 }
diff --git a/core/api/src/main/java/org/onosproject/net/meter/MeterOperation.java b/core/api/src/main/java/org/onosproject/net/meter/MeterOperation.java
index 50e6fe9..437dd26 100644
--- a/core/api/src/main/java/org/onosproject/net/meter/MeterOperation.java
+++ b/core/api/src/main/java/org/onosproject/net/meter/MeterOperation.java
@@ -16,15 +16,13 @@
 package org.onosproject.net.meter;
 
 import com.google.common.base.MoreObjects;
-
-import java.util.Optional;
+import com.google.common.base.Objects;
 
 /**
  * Representation of an operation on the meter table.
  */
 public class MeterOperation {
 
-    private final Optional<MeterContext> context;
 
     /**
      * Tyoe of meter operation.
@@ -39,10 +37,9 @@
     private final Type type;
 
 
-    public MeterOperation(Meter meter, Type type, MeterContext context) {
+    public MeterOperation(Meter meter, Type type) {
         this.meter = meter;
         this.type = type;
-        this.context = Optional.ofNullable(context);
     }
 
     /**
@@ -63,16 +60,6 @@
         return meter;
     }
 
-    /**
-     * Returns a context which allows application to
-     * be notified on the success value of this operation.
-     *
-     * @return a meter context
-     */
-    public Optional<MeterContext> context() {
-        return this.context;
-    }
-
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(this)
@@ -80,4 +67,22 @@
                 .add("type", type)
                 .toString();
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MeterOperation that = (MeterOperation) o;
+        return Objects.equal(meter, that.meter) &&
+                Objects.equal(type, that.type);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(meter, type);
+    }
 }
diff --git a/core/api/src/main/java/org/onosproject/net/meter/MeterRequest.java b/core/api/src/main/java/org/onosproject/net/meter/MeterRequest.java
new file mode 100644
index 0000000..fd11ca4
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/meter/MeterRequest.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.net.meter;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.DeviceId;
+
+import java.util.Collection;
+import java.util.Optional;
+
+/**
+ * Represents a generalized meter request to be deployed on a device.
+ */
+public interface MeterRequest {
+
+    enum Type {
+        ADD,
+        MODIFY,
+        REMOVE
+    }
+
+    /**
+     * The target device for this meter.
+     *
+     * @return a device id
+     */
+    DeviceId deviceId();
+
+    /**
+     * The id of the application which created this meter.
+     *
+     * @return an application id
+     */
+    ApplicationId appId();
+
+    /**
+     * The unit used within this meter.
+     *
+     * @return the unit
+     */
+    Meter.Unit unit();
+
+    /**
+     * Signals whether this meter applies to bursts only.
+     *
+     * @return a boolean
+     */
+    boolean isBurst();
+
+    /**
+     * The collection of bands to apply on the dataplane.
+     *
+     * @return a collection of bands.
+     */
+    Collection<Band> bands();
+
+    /**
+     * Returns the callback context for this meter.
+     *
+     * @return an optional meter context
+     */
+    Optional<MeterContext> context();
+
+    /**
+     * A meter builder.
+     */
+    interface Builder {
+
+        /**
+         * Assigns the target device for this meter.
+         *
+         * @param deviceId a device id
+         * @return this
+         */
+        Builder forDevice(DeviceId deviceId);
+
+        /**
+         * Assigns the application that built this meter.
+         *
+         * @param appId an application id
+         * @return this
+         */
+        Builder fromApp(ApplicationId appId);
+
+        /**
+         * Assigns the @See Unit to use for this meter.
+         * Defaults to kb/s
+         *
+         * @param unit a unit
+         * @return this
+         */
+        Builder withUnit(Meter.Unit unit);
+
+        /**
+         * Sets this meter as applicable to burst traffic only.
+         * Defaults to false.
+         *
+         * @return this
+         */
+        Builder burst();
+
+        /**
+         * Assigns bands to this meter. There must be at least one band.
+         *
+         * @param bands a collection of bands
+         * @return this
+         */
+        Builder withBands(Collection<Band> bands);
+
+        /**
+         * Assigns an execution context for this meter request.
+         *
+         * @param context a meter context
+         * @return this
+         */
+        Builder withContext(MeterContext context);
+
+        /**
+         * Requests the addition of a meter.
+         *
+         * @return a meter request
+         */
+        MeterRequest add();
+
+        /**
+         * Requests the removal of a meter.
+         *
+         * @return a meter request
+         */
+        MeterRequest remove();
+
+    }
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/meter/MeterService.java b/core/api/src/main/java/org/onosproject/net/meter/MeterService.java
index 31aa17f..bdc90eb 100644
--- a/core/api/src/main/java/org/onosproject/net/meter/MeterService.java
+++ b/core/api/src/main/java/org/onosproject/net/meter/MeterService.java
@@ -30,23 +30,18 @@
     /**
      * Adds a meter to the system and performs it installation.
      *
-     * @param meter a meter.
+     * @param meter a meter
+     * @return a meter (with a meter id)
      */
-    void addMeter(MeterOperation meter);
-
-    /**
-     * Updates a meter by adding statistic information to the meter.
-     *
-     * @param meter an updated meter
-     */
-    void updateMeter(MeterOperation meter);
+    Meter submit(MeterRequest meter);
 
     /**
      * Remove a meter from the system and the dataplane.
      *
      * @param meter a meter to remove
+     * @param meterId the meter id of the meter to remove.
      */
-    void removeMeter(MeterOperation meter);
+    void withdraw(MeterRequest meter, MeterId meterId);
 
     /**
      * Fetch the meter by the meter id.
@@ -63,10 +58,4 @@
      */
     Collection<Meter> getAllMeters();
 
-    /**
-     * Allocate a meter id which must be used to create the meter.
-     *
-     * @return a meter id
-     */
-    MeterId allocateMeterId();
 }
diff --git a/core/api/src/test/java/org/onosproject/net/meter/DefaultMeterTest.java b/core/api/src/test/java/org/onosproject/net/meter/DefaultMeterTest.java
new file mode 100644
index 0000000..b39d2ef
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/net/meter/DefaultMeterTest.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.net.meter;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.onosproject.net.NetTestTools.APP_ID;
+import static org.onosproject.net.NetTestTools.did;
+
+
+/**
+ * DefaultMeter Tests.
+ */
+public class DefaultMeterTest {
+
+    private Meter m1;
+    private Meter sameAsm1;
+    private Meter m2;
+
+    @Before
+    public void setup() {
+
+        Band band = DefaultBand.builder()
+                .ofType(Band.Type.DROP)
+                .withRate(500)
+                .build();
+
+        m1 = DefaultMeter.builder()
+                .forDevice(did("1"))
+                .fromApp(APP_ID)
+                .withId(MeterId.meterId(1))
+                .withUnit(Meter.Unit.KB_PER_SEC)
+                .withBands(Collections.singletonList(band))
+                .build();
+
+        sameAsm1 = DefaultMeter.builder()
+                .forDevice(did("1"))
+                .fromApp(APP_ID)
+                .withId(MeterId.meterId(1))
+                .withUnit(Meter.Unit.KB_PER_SEC)
+                .withBands(Collections.singletonList(band))
+                .build();
+
+        m2 = DefaultMeter.builder()
+                .forDevice(did("2"))
+                .fromApp(APP_ID)
+                .withId(MeterId.meterId(2))
+                .withUnit(Meter.Unit.KB_PER_SEC)
+                .withBands(Collections.singletonList(band))
+                .build();
+
+    }
+
+    @Test
+    public void testEquality() {
+        new EqualsTester()
+                .addEqualityGroup(m1, sameAsm1)
+                .addEqualityGroup(m2).testEquals();
+    }
+
+    @Test
+    public void testConstruction() {
+        DefaultMeter m = (DefaultMeter) m1;
+
+        assertThat(m.deviceId(), is(did("1")));
+        assertThat(m.appId(), is(APP_ID));
+        assertThat(m.id(), is(MeterId.meterId(1)));
+        assertThat(m.isBurst(), is(false));
+
+        assertThat(m.life(), is(0L));
+        assertThat(m.bytesSeen(), is(0L));
+        assertThat(m.packetsSeen(), is(0L));
+        assertThat(m.referenceCount(), is(0L));
+
+    }
+
+
+
+
+}
diff --git a/core/api/src/test/java/org/onosproject/net/meter/MeterOperationTest.java b/core/api/src/test/java/org/onosproject/net/meter/MeterOperationTest.java
new file mode 100644
index 0000000..ad53e3a
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/net/meter/MeterOperationTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.net.meter;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.DeviceId;
+
+import java.util.Collection;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutableBaseClass;
+
+/**
+ * Unit tests for the MeterOperationTest object.
+ */
+public class MeterOperationTest {
+
+
+
+    /**
+     * Checks that the MeterOperation class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutableBaseClass(MeterOperation.class);
+    }
+
+    @Test
+    public void testEquality() {
+        final Meter m1 = new TestMeter();
+        final Meter m2 = new TestMeter();
+        final MeterOperation op1 = new MeterOperation(m1,
+                                                      MeterOperation.Type.ADD);
+        final MeterOperation sameAsOp1 = new MeterOperation(m1,
+                                                            MeterOperation.Type.ADD);
+        final MeterOperation op2 = new MeterOperation(m2,
+                                            MeterOperation.Type.ADD);
+
+        new EqualsTester()
+                .addEqualityGroup(op1, sameAsOp1)
+                .addEqualityGroup(op2)
+                .testEquals();
+    }
+
+    @Test
+    public void testConstruction() {
+        final Meter m1 = new TestMeter();
+
+        final MeterOperation op = new MeterOperation(m1, MeterOperation.Type.ADD);
+
+        assertThat(op.meter(), is(m1));
+    }
+
+    private static final class TestMeter implements Meter {
+
+        @Override
+        public DeviceId deviceId() {
+            return null;
+        }
+
+        @Override
+        public MeterId id() {
+            return null;
+        }
+
+        @Override
+        public ApplicationId appId() {
+            return null;
+        }
+
+        @Override
+        public Unit unit() {
+            return null;
+        }
+
+        @Override
+        public boolean isBurst() {
+            return false;
+        }
+
+        @Override
+        public Collection<Band> bands() {
+            return null;
+        }
+
+        @Override
+        public MeterState state() {
+            return null;
+        }
+
+        @Override
+        public long life() {
+            return 0;
+        }
+
+        @Override
+        public long referenceCount() {
+            return 0;
+        }
+
+        @Override
+        public long packetsSeen() {
+            return 0;
+        }
+
+        @Override
+        public long bytesSeen() {
+            return 0;
+        }
+    }
+
+}
diff --git a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
index c45f696..0136a94 100644
--- a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
+++ b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
@@ -21,6 +21,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BiFunction;
 import java.util.function.Function;
 import java.util.function.Predicate;
@@ -38,6 +39,7 @@
     private final List<MapEventListener<K, V>> listeners;
     private final HashMap<K, V> map;
     private final String mapName;
+    private final AtomicLong counter = new AtomicLong(0);
 
     private TestConsistentMap(String mapName) {
         map = new HashMap<>();
@@ -46,7 +48,7 @@
     }
 
     private Versioned<V> version(V v) {
-        return new Versioned<>(v, 1, System.currentTimeMillis());
+        return new Versioned<>(v, counter.incrementAndGet(), System.currentTimeMillis());
     }
 
     /**
@@ -115,8 +117,12 @@
 
     @Override
     public Versioned<V> put(K key, V value) {
-        Versioned<V> result = version(map.put(key, value));
-        notifyListeners(mapName, INSERT, key, result);
+        Versioned<V> result = version(value);
+        if (map.put(key, value) == null) {
+            notifyListeners(mapName, INSERT, key, result);
+        } else {
+            notifyListeners(mapName, UPDATE, key, result);
+        }
         return result;
     }
 
@@ -213,6 +219,11 @@
         listeners.remove(listener);
     }
 
+    @Override
+    public Map<K, V> asJavaMap() {
+        return map;
+    }
+
     public static Builder builder() {
         return new Builder();
     }
