NPE_app_delete

Change-Id: I2af8fd7da6c4e5963d07f23ce9d4dc89e35ed30c
(cherry picked from commit e113b65a6c50762a7a85414fdbef3d9f3427604a)
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/ApplicationsWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/ApplicationsWebResource.java
index ea22d46..3a4eb5c 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/ApplicationsWebResource.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/ApplicationsWebResource.java
@@ -149,7 +149,9 @@
     public Response uninstallApp(@PathParam("name") String name) {
         ApplicationAdminService service = get(ApplicationAdminService.class);
         ApplicationId appId = service.getId(name);
-        service.uninstall(appId);
+        if (appId != null) {
+            service.uninstall(appId);
+        }
         return Response.noContent().build();
     }
 
@@ -175,7 +177,7 @@
      * De-activates the specified application.
      *
      * @param name application name
-     * @return 200 OK; 404; 401
+     * @return 204 NO CONTENT
      */
     @DELETE
     @Produces(MediaType.APPLICATION_JSON)
@@ -183,8 +185,10 @@
     public Response deactivateApp(@PathParam("name") String name) {
         ApplicationAdminService service = get(ApplicationAdminService.class);
         ApplicationId appId = service.getId(name);
-        service.deactivate(appId);
-        return response(service, appId);
+        if (appId != null) {
+            service.deactivate(appId);
+        }
+        return Response.noContent().build();
     }
 
     /**