diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/VplsManager.java b/apps/vpls/src/main/java/org/onosproject/vpls/VplsManager.java
index 425f77d..293f92b 100644
--- a/apps/vpls/src/main/java/org/onosproject/vpls/VplsManager.java
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/VplsManager.java
@@ -16,6 +16,7 @@
 package org.onosproject.vpls;
 
 import com.google.common.collect.ImmutableSet;
+import org.onosproject.codec.CodecService;
 import org.onosproject.net.EncapsulationType;
 import org.onosproject.net.Host;
 import org.onosproject.net.host.HostEvent;
@@ -29,6 +30,7 @@
 import org.onosproject.vpls.api.VplsOperation;
 import org.onosproject.vpls.api.VplsOperationService;
 import org.onosproject.vpls.api.VplsStore;
+import org.onosproject.vpls.rest.VplsCodec;
 import org.onosproject.vpls.store.VplsStoreEvent;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -65,9 +67,13 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected VplsOperationService operationService;
 
+    @Reference(cardinality = ReferenceCardinality.MANDATORY)
+    protected CodecService codecService;
+
     private StoreDelegate<VplsStoreEvent> vplsStoreDelegate;
     private HostListener vplsHostListener;
 
+
     @Activate
     public void activate() {
         vplsStoreDelegate = new VplsStoreDelegate();
@@ -75,12 +81,14 @@
 
         vplsStore.setDelegate(vplsStoreDelegate);
         hostService.addListener(vplsHostListener);
+        codecService.registerCodec(VplsData.class, new VplsCodec());
     }
 
     @Deactivate
     public void deactivate() {
         vplsStore.unsetDelegate(vplsStoreDelegate);
         hostService.removeListener(vplsHostListener);
+        codecService.unregisterCodec(VplsData.class);
     }
 
     @Override
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsCodec.java b/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsCodec.java
new file mode 100644
index 0000000..8f8bf3f
--- /dev/null
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsCodec.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * 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.vpls.rest;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.onosproject.codec.CodecContext;
+import org.onosproject.codec.JsonCodec;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.net.intf.Interface;
+import org.onosproject.vpls.api.VplsData;
+import org.slf4j.Logger;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.stream.IntStream;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+/**
+ * Vpls JSON codec.
+ */
+public final class VplsCodec extends JsonCodec<VplsData> {
+
+    // JSON field names
+    private static final String NAME = "name";
+    private static final String ENCAPSULATION_TYPE = "encapsulation";
+    private static final String INTERFACES = "interfaces";
+
+    private final Logger log = getLogger(getClass());
+
+    @Override
+    public ObjectNode encode(VplsData vplsData, CodecContext context) {
+        checkNotNull(vplsData, "Vpls cannot be null");
+        ObjectNode result = context.mapper().createObjectNode()
+                .put(NAME, vplsData.name())
+                .put(ENCAPSULATION_TYPE, vplsData.encapsulationType().toString());
+        ArrayNode interfaces = context.mapper().createArrayNode();
+        vplsData.interfaces().forEach(interf -> {
+            ObjectNode bandJson = context.codec(Interface.class).encode(interf, context);
+            interfaces.add(bandJson);
+        });
+        result.set(INTERFACES, interfaces);
+        return result;
+    }
+    @Override
+    public VplsData decode(ObjectNode json, CodecContext context) {
+        if (json == null || !json.isObject()) {
+            return null;
+        }
+
+        String vplsName = json.findValue(NAME).asText();
+        EncapsulationType encap = EncapsulationType.enumFromString(json.findValue(ENCAPSULATION_TYPE).asText());
+        VplsData vplsData = VplsData.of(vplsName, encap);
+
+        Collection<Interface> interfaceList = new ArrayList<>();
+        JsonNode interfacesJeson = json.findValue(INTERFACES);
+        JsonCodec<Interface> interfaceCodec = context.codec(Interface.class);
+        if (interfacesJeson != null) {
+            IntStream.range(0, interfacesJeson.size())
+                    .forEach(i -> interfaceList.add(
+                            interfaceCodec.decode(get(interfacesJeson, i),
+                                    context)));
+            vplsData.addInterfaces(interfaceList);
+        }
+        return vplsData;
+    }
+
+}
+
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsWebApplication.java b/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsWebApplication.java
new file mode 100644
index 0000000..0581130
--- /dev/null
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsWebApplication.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * 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.vpls.rest;
+
+import org.onlab.rest.AbstractWebApplication;
+
+import java.util.Set;
+
+/**
+ * VPLS web application.
+ */
+public class VplsWebApplication extends AbstractWebApplication {
+    @Override
+    public Set<Class<?>> getClasses() {
+        return getClasses(VplsWebResource.class);
+    }
+}
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsWebResource.java b/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsWebResource.java
new file mode 100644
index 0000000..ae227ed
--- /dev/null
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/rest/VplsWebResource.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * 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.vpls.rest;
+
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.onosproject.net.intf.Interface;
+import org.onosproject.net.intf.InterfaceAdminService;
+import org.onosproject.rest.AbstractWebResource;
+import org.onosproject.vpls.api.Vpls;
+import org.onosproject.vpls.api.VplsData;
+
+import org.slf4j.Logger;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.ArrayList;
+
+
+import static org.onlab.util.Tools.readTreeFromStream;
+import static org.onlab.util.Tools.nullIsNotFound;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Query and program Vplss.
+ */
+@Path("vpls")
+public class VplsWebResource extends AbstractWebResource {
+    @Context
+    private UriInfo uriInfo;
+
+    private static final String VPLS_NOT_FOUND = "Vpls is not found for ";
+    private static final String VPLSS = "vplss";
+    private static final String VPLS = "vpls";
+    private static final String INTERFACES = "interfaces";
+
+    private final ObjectNode root = mapper().createObjectNode();
+    private final Logger log = getLogger(getClass());
+    /**
+     * Gets all Vplss. Returns array of all Vplss in the system.
+     *
+     * @return 200 OK with a collection of Vplss
+     * @onos.rsModel Vplss
+     */
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response getVplss() {
+        ArrayNode vplssNode = root.putArray(VPLSS);
+        Vpls service = get(Vpls.class);
+        Collection<VplsData> vplsDatas = service.getAllVpls();
+        if (!vplsDatas.isEmpty()) {
+            for (VplsData entry : vplsDatas) {
+                vplssNode.add(codec(VplsData.class).encode(entry, this));
+            }
+        }
+
+        return ok(root).build();
+    }
+
+    /**
+     * Gets Vpls. Returns a Vpls by vplsName.
+     * @param  vplsName  vpls name
+     * @return 200 OK with a vpls, return 404 if no entry has been found
+     * @onos.rsModel Vpls
+     */
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    @Path("{vplsName}")
+    public Response getVpls(@PathParam("vplsName") String vplsName) {
+        ArrayNode vplsNode = root.putArray(VPLS);
+        Vpls service = get(Vpls.class);
+        final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName),
+                VPLS_NOT_FOUND + vplsName);
+        vplsNode.add(codec(VplsData.class).encode(vplsData, this));
+
+        return ok(root).build();
+    }
+    /**
+     * Creates new vpls. Creates and installs a new Vplps.<br>
+     *
+     * @param stream Vpls JSON
+     * @return status of the request - CREATED if the JSON is correct,
+     * BAD_REQUEST if the JSON is invalid
+     * @onos.rsModel VplsPost
+     */
+    @POST
+    @Consumes(MediaType.APPLICATION_JSON)
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response createVpls(InputStream stream) {
+        Vpls service = get(Vpls.class);
+        InterfaceAdminService interfaceService = get(InterfaceAdminService.class);
+        try {
+            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
+
+            VplsData vplsData = codec(VplsData.class).decode(jsonTree, this);
+            vplsData.interfaces().forEach(interf -> {
+                    interfaceService.add(interf);
+            });
+            service.addInterfaces(vplsData, vplsData.interfaces());
+
+            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
+                    .path(VPLS);
+            return Response
+                    .created(locationBuilder.build())
+                    .build();
+
+            } catch (IOException e) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+
+    }
+
+    /**
+     * Add new interfaces. Add new interfaces to a Vpls.<br>
+     *
+     * @param stream interfaces JSON
+     * @param vplsName Vpls name
+     * @return status of the request - CREATED if the JSON is correct,
+     * BAD_REQUEST if the JSON is invalid
+     * @onos.rsModel InterfacesPost
+     */
+    @POST
+    @Path("interfaces/{vplsName}")
+    @Consumes(MediaType.APPLICATION_JSON)
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response addInterfaces(@PathParam("vplsName") String vplsName, InputStream stream) {
+        Vpls service = get(Vpls.class);
+        InterfaceAdminService interfaceService = get(InterfaceAdminService.class);
+        final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName),
+                VPLS_NOT_FOUND + vplsName);
+        try {
+            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
+            Collection<Interface> interfaceList = new ArrayList<>();
+            jsonTree.forEach(interf -> {
+                Interface inter = codec(Interface.class).decode(jsonTree, this);
+                interfaceList.add(inter);
+                interfaceService.add(inter);
+            });
+            service.addInterfaces(vplsData, interfaceList);
+            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
+                    .path(INTERFACES)
+                    .path(vplsName);
+            return Response
+                    .created(locationBuilder.build())
+                    .build();
+
+        } catch (IOException e) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+
+    }
+
+    /**
+     * Removes the specified vpls.
+     *
+     * @param vplsName Vpls name
+     * @return 204 NO CONTENT
+     */
+    @DELETE
+    @Path("{vplsName}")
+    public Response deleteVpls(@PathParam("vplsName") String vplsName) {
+        Vpls service = get(Vpls.class);
+        final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName),
+                VPLS_NOT_FOUND + vplsName);
+        service.removeVpls(vplsData);
+        return Response.noContent().build();
+    }
+
+    /**
+     * Removes a specified interface.
+     *
+     * @param vplsName Vpls name
+     * @param interfaceName interface name
+     * @return 204 NO CONTENT
+     *
+     */
+    @DELETE
+    @Path("interface/{vplsName}/{interfaceName}")
+    public Response deleteInterface(@PathParam("vplsName") String vplsName,
+                                    @PathParam("interfaceName") String interfaceName) {
+        Vpls service = get(Vpls.class);
+        InterfaceAdminService interfaceService = get(InterfaceAdminService.class);
+        final VplsData vplsData = nullIsNotFound(service.getVpls(vplsName),
+                VPLS_NOT_FOUND + vplsName);
+        vplsData.interfaces().forEach(anInterface -> {
+            if (anInterface.name().equals(interfaceName)) {
+                interfaceService.remove(anInterface.connectPoint(), anInterface.name());
+                service.removeInterface(vplsData, anInterface);
+            }
+        });
+
+        return Response.noContent().build();
+    }
+
+}
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/rest/package-info.java b/apps/vpls/src/main/java/org/onosproject/vpls/rest/package-info.java
new file mode 100644
index 0000000..f8adcdf
--- /dev/null
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/rest/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.
+ */
+
+/**
+ * Implementation REST for VPLS services.
+ */
+package org.onosproject.vpls.rest;
\ No newline at end of file
