diff --git a/models-tosca/pom.xml b/models-tosca/pom.xml
index b04d2a5..eaa1f47 100644
--- a/models-tosca/pom.xml
+++ b/models-tosca/pom.xml
@@ -1,6 +1,7 @@
 <!--
   ============LICENSE_START=======================================================
    Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+   Modifications Copyright (C) 2020 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -64,6 +65,12 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+            <version>4.4</version>
+        </dependency>
+
+        <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
             <scope>test</scope>
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
index cce6fd9..0a7983c 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
@@ -29,6 +29,7 @@
 
 import lombok.NonNull;
 
+import org.apache.commons.collections4.CollectionUtils;
 import org.onap.policy.models.base.PfConcept;
 import org.onap.policy.models.base.PfConceptFilter;
 import org.onap.policy.models.base.PfConceptKey;
@@ -187,6 +188,14 @@
         List<JpaToscaPolicyType> jpaPolicyTypeList = dao.getFiltered(JpaToscaPolicyType.class, name, version);
         serviceTemplate.getPolicyTypes().getConceptMap().putAll(asConceptMap(jpaPolicyTypeList));
 
+        // Return all data types
+        // TODO: In the next review, return just the data types used by the policy types on the policy type list
+        List<JpaToscaDataType> jpaDataTypeList = dao.getFiltered(JpaToscaDataType.class, null, null);
+        if (!CollectionUtils.isEmpty(jpaDataTypeList)) {
+            serviceTemplate.setDataTypes(new JpaToscaDataTypes());
+            serviceTemplate.getDataTypes().getConceptMap().putAll(asConceptMap(jpaDataTypeList));
+        }
+
         LOGGER.debug("<-getPolicyTypes: name={}, version={}, serviceTemplate={}", name, version, serviceTemplate);
         return serviceTemplate;
     }
@@ -205,6 +214,11 @@
 
         ToscaUtils.assertPolicyTypesExist(serviceTemplate);
 
+        // Create the data types on the policy type
+        if (ToscaUtils.doDataTypesExist(serviceTemplate)) {
+            createDataTypes(dao, serviceTemplate);
+        }
+
         for (JpaToscaPolicyType policyType : serviceTemplate.getPolicyTypes().getAll(null)) {
             dao.create(policyType);
         }
@@ -237,6 +251,11 @@
 
         ToscaUtils.assertPolicyTypesExist(serviceTemplate);
 
+        // Update the data types on the policy type
+        if (ToscaUtils.doDataTypesExist(serviceTemplate)) {
+            updateDataTypes(dao, serviceTemplate);
+        }
+
         for (JpaToscaPolicyType policyType : serviceTemplate.getPolicyTypes().getAll(null)) {
             dao.update(policyType);
         }
@@ -444,7 +463,7 @@
         // Policy type version is not specified, get the latest version from the database
         List<JpaToscaPolicyType> jpaPolicyTypeList = dao.getFiltered(JpaToscaPolicyType.class, policyTypeName, null);
 
-        if (jpaPolicyTypeList.isEmpty()) {
+        if (CollectionUtils.isEmpty(jpaPolicyTypeList)) {
             return null;
         }
 
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java
index 23a428b..71158f0 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java
@@ -43,22 +43,86 @@
     }
 
     /**
-     * Check if data types have been specified correctly.
+     * Assert that data types have been specified correctly.
      *
      * @param serviceTemplate the service template containing data types to be checked
      */
     public static void assertDataTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
+        String message = checkDataTypesExist(serviceTemplate);
+        if (message != null) {
+            LOGGER.warn(message);
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, message);
+        }
+    }
+
+    /**
+     * Assert that policy types have been specified correctly.
+     *
+     * @param serviceTemplate the service template containing policy types to be checked
+     */
+    public static void assertPolicyTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
+        String message = checkPolicyTypesExist(serviceTemplate);
+        if (message != null) {
+            LOGGER.warn(message);
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, message);
+        }
+    }
+
+    /**
+     * Assert that policies have been specified correctly.
+     *
+     * @param serviceTemplate the service template containing policy types to be checked
+     */
+    public static void assertPoliciesExist(final JpaToscaServiceTemplate serviceTemplate) {
+        String message = checkPoliciesExist(serviceTemplate);
+        if (message != null) {
+            LOGGER.warn(message);
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, message);
+        }
+    }
+
+    /**
+     * Check that data types have been specified correctly.
+     *
+     * @param serviceTemplate the service template containing data types to be checked
+     */
+    public static boolean doDataTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
+        return checkDataTypesExist(serviceTemplate) == null;
+    }
+
+    /**
+     * Check that policy types have been specified correctly.
+     *
+     * @param serviceTemplate the service template containing policy types to be checked
+     */
+    public static boolean doPolicyTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
+        return checkPolicyTypesExist(serviceTemplate) == null;
+    }
+
+    /**
+     * Check that policies have been specified correctly.
+     *
+     * @param serviceTemplate the service template containing policy types to be checked
+     */
+    public static boolean doPoliciesExist(final JpaToscaServiceTemplate serviceTemplate) {
+        return checkPoliciesExist(serviceTemplate) == null;
+    }
+
+    /**
+     * Check if data types have been specified correctly.
+     *
+     * @param serviceTemplate the service template containing data types to be checked
+     */
+    public static String checkDataTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
         if (serviceTemplate.getDataTypes() == null) {
-            String errorMessage = "no data types specified on service template";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "no data types specified on service template";
         }
 
         if (serviceTemplate.getDataTypes().getConceptMap().isEmpty()) {
-            String errorMessage = "list of data types specified on service template is empty";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "list of data types specified on service template is empty";
         }
+
+        return null;
     }
 
     /**
@@ -66,18 +130,16 @@
      *
      * @param serviceTemplate the service template containing policy types to be checked
      */
-    public static void assertPolicyTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
+    public static String checkPolicyTypesExist(final JpaToscaServiceTemplate serviceTemplate) {
         if (serviceTemplate.getPolicyTypes() == null) {
-            String errorMessage = "no policy types specified on service template";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "no policy types specified on service template";
         }
 
         if (serviceTemplate.getPolicyTypes().getConceptMap().isEmpty()) {
-            String errorMessage = "list of policy types specified on service template is empty";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "list of policy types specified on service template is empty";
         }
+
+        return null;
     }
 
     /**
@@ -85,23 +147,19 @@
      *
      * @param serviceTemplate the service template containing policy types to be checked
      */
-    public static void assertPoliciesExist(final JpaToscaServiceTemplate serviceTemplate) {
+    public static String checkPoliciesExist(final JpaToscaServiceTemplate serviceTemplate) {
         if (serviceTemplate.getTopologyTemplate() == null) {
-            String errorMessage = "topology template not specified on service template";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "topology template not specified on service template";
         }
 
         if (serviceTemplate.getTopologyTemplate().getPolicies() == null) {
-            String errorMessage = "no policies specified on topology template of service template";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "no policies specified on topology template of service template";
         }
 
         if (serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap().isEmpty()) {
-            String errorMessage = "list of policies specified on topology template of service template is empty";
-            LOGGER.warn(errorMessage);
-            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+            return "list of policies specified on topology template of service template is empty";
         }
+
+        return null;
     }
 }
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
index db6dc52..63ebcbd 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
@@ -46,6 +46,8 @@
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaDataType;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaDataTypes;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicies;
+import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicyType;
+import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicyTypes;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaTopologyTemplate;
 import org.yaml.snakeyaml.Yaml;
@@ -114,6 +116,7 @@
         JpaToscaServiceTemplate createdServiceTemplate =
                 new SimpleToscaProvider().createDataTypes(pfDao, serviceTemplate);
 
+        assertEquals(1, createdServiceTemplate.getDataTypes().getConceptMap().size());
         assertEquals(dataType0, createdServiceTemplate.getDataTypes().get(dataType0Key));
         assertEquals(null, createdServiceTemplate.getDataTypes().get(dataType0Key).getDescription());
 
@@ -143,6 +146,101 @@
     }
 
     @Test
+    public void testCreateUpdateGetDeletePolicyType() throws PfModelException {
+        JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
+
+        PfConceptKey dataType0Key = new PfConceptKey("DataType0", "0.0.1");
+        JpaToscaDataType dataType0 = new JpaToscaDataType();
+        dataType0.setKey(dataType0Key);
+        serviceTemplate.setDataTypes(new JpaToscaDataTypes());
+        serviceTemplate.getDataTypes().getConceptMap().put(dataType0Key, dataType0);
+
+        PfConceptKey policyType0Key = new PfConceptKey("PolicyType0", "0.0.1");
+        JpaToscaPolicyType policyType0 = new JpaToscaPolicyType();
+        policyType0.setKey(policyType0Key);
+        serviceTemplate.setPolicyTypes(new JpaToscaPolicyTypes());
+        serviceTemplate.getPolicyTypes().getConceptMap().put(policyType0Key, policyType0);
+
+        JpaToscaServiceTemplate createdServiceTemplate =
+                new SimpleToscaProvider().createPolicyTypes(pfDao, serviceTemplate);
+
+        assertEquals(1, createdServiceTemplate.getPolicyTypes().getConceptMap().size());
+        assertEquals(policyType0, createdServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals(null, createdServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        policyType0.setDescription("Updated Description");
+
+        JpaToscaServiceTemplate updatedServiceTemplate =
+                new SimpleToscaProvider().updatePolicyTypes(pfDao, serviceTemplate);
+
+        assertEquals(policyType0, updatedServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals("Updated Description",
+                updatedServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        JpaToscaServiceTemplate gotServiceTemplate =
+                new SimpleToscaProvider().getPolicyTypes(pfDao, policyType0Key.getName(), policyType0Key.getVersion());
+
+        assertEquals(policyType0, gotServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals("Updated Description", gotServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        JpaToscaServiceTemplate deletedServiceTemplate =
+                new SimpleToscaProvider().deletePolicyType(pfDao, policyType0Key);
+
+        assertEquals(policyType0, deletedServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals("Updated Description",
+                deletedServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        JpaToscaServiceTemplate doesNotExistServiceTemplate =
+                new SimpleToscaProvider().deletePolicyType(pfDao, policyType0Key);
+
+        assertEquals(null, doesNotExistServiceTemplate.getPolicyTypes().get(policyType0Key));
+    }
+
+    @Test
+    public void testCreateUpdateGetDeletePolicyTypeWithDataType() throws PfModelException {
+        JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
+
+        PfConceptKey policyType0Key = new PfConceptKey("PolicyType0", "0.0.1");
+        JpaToscaPolicyType policyType0 = new JpaToscaPolicyType();
+        policyType0.setKey(policyType0Key);
+        serviceTemplate.setPolicyTypes(new JpaToscaPolicyTypes());
+        serviceTemplate.getPolicyTypes().getConceptMap().put(policyType0Key, policyType0);
+
+        JpaToscaServiceTemplate createdServiceTemplate =
+                new SimpleToscaProvider().createPolicyTypes(pfDao, serviceTemplate);
+
+        assertEquals(policyType0, createdServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals(null, createdServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        policyType0.setDescription("Updated Description");
+
+        JpaToscaServiceTemplate updatedServiceTemplate =
+                new SimpleToscaProvider().updatePolicyTypes(pfDao, serviceTemplate);
+
+        assertEquals(policyType0, updatedServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals("Updated Description",
+                updatedServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        JpaToscaServiceTemplate gotServiceTemplate =
+                new SimpleToscaProvider().getPolicyTypes(pfDao, policyType0Key.getName(), policyType0Key.getVersion());
+
+        assertEquals(policyType0, gotServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals("Updated Description", gotServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        JpaToscaServiceTemplate deletedServiceTemplate =
+                new SimpleToscaProvider().deletePolicyType(pfDao, policyType0Key);
+
+        assertEquals(policyType0, deletedServiceTemplate.getPolicyTypes().get(policyType0Key));
+        assertEquals("Updated Description",
+                deletedServiceTemplate.getPolicyTypes().get(policyType0Key).getDescription());
+
+        JpaToscaServiceTemplate doesNotExistServiceTemplate =
+                new SimpleToscaProvider().deletePolicyType(pfDao, policyType0Key);
+
+        assertEquals(null, doesNotExistServiceTemplate.getPolicyTypes().get(policyType0Key));
+    }
+
+    @Test
     public void testPoliciesGet() throws Exception {
         ToscaServiceTemplate toscaServiceTemplate =
                 standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/utils/ToscaUtilsTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/utils/ToscaUtilsTest.java
index b7c814a..8263694 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/utils/ToscaUtilsTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/utils/ToscaUtilsTest.java
@@ -22,6 +22,9 @@
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
 import org.onap.policy.models.base.PfConceptKey;
@@ -42,39 +45,56 @@
     public void testAssertDataTypes() {
         JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
 
+        assertFalse(ToscaUtils.doDataTypesExist(jpaToscaServiceTemplate));
+        assertEquals("no data types specified on service template",
+                ToscaUtils.checkDataTypesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertDataTypesExist(jpaToscaServiceTemplate);
         }).hasMessage("no data types specified on service template");
 
         jpaToscaServiceTemplate.setDataTypes(new JpaToscaDataTypes());
 
+        assertFalse(ToscaUtils.doDataTypesExist(jpaToscaServiceTemplate));
+        assertEquals("list of data types specified on service template is empty",
+                ToscaUtils.checkDataTypesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertDataTypesExist(jpaToscaServiceTemplate);
         }).hasMessage("list of data types specified on service template is empty");
 
         jpaToscaServiceTemplate.getDataTypes().getConceptMap().put(new PfConceptKey(), null);
 
+        assertTrue(ToscaUtils.doDataTypesExist(jpaToscaServiceTemplate));
+        assertEquals(null, ToscaUtils.checkDataTypesExist(jpaToscaServiceTemplate));
         assertThatCode(() -> {
             ToscaUtils.assertDataTypesExist(jpaToscaServiceTemplate);
         }).doesNotThrowAnyException();
+
     }
 
     @Test
     public void testAssertPolicyTypes() {
         JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
 
+        assertFalse(ToscaUtils.doPolicyTypesExist(jpaToscaServiceTemplate));
+        assertEquals("no policy types specified on service template",
+                ToscaUtils.checkPolicyTypesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertPolicyTypesExist(jpaToscaServiceTemplate);
         }).hasMessage("no policy types specified on service template");
 
         jpaToscaServiceTemplate.setPolicyTypes(new JpaToscaPolicyTypes());
 
+        assertFalse(ToscaUtils.doPolicyTypesExist(jpaToscaServiceTemplate));
+        assertEquals("list of policy types specified on service template is empty",
+                ToscaUtils.checkPolicyTypesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertPolicyTypesExist(jpaToscaServiceTemplate);
         }).hasMessage("list of policy types specified on service template is empty");
 
         jpaToscaServiceTemplate.getPolicyTypes().getConceptMap().put(new PfConceptKey(), null);
 
+        assertTrue(ToscaUtils.doPolicyTypesExist(jpaToscaServiceTemplate));
+        assertEquals(null, ToscaUtils.checkPolicyTypesExist(jpaToscaServiceTemplate));
         assertThatCode(() -> {
             ToscaUtils.assertPolicyTypesExist(jpaToscaServiceTemplate);
         }).doesNotThrowAnyException();
@@ -84,24 +104,35 @@
     public void testAssertPolicies() {
         JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
 
+        assertFalse(ToscaUtils.doPoliciesExist(jpaToscaServiceTemplate));
+        assertEquals("topology template not specified on service template",
+                ToscaUtils.checkPoliciesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertPoliciesExist(jpaToscaServiceTemplate);
         }).hasMessage("topology template not specified on service template");
 
         jpaToscaServiceTemplate.setTopologyTemplate(new JpaToscaTopologyTemplate());
 
+        assertFalse(ToscaUtils.doPoliciesExist(jpaToscaServiceTemplate));
+        assertEquals("no policies specified on topology template of service template",
+                ToscaUtils.checkPoliciesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertPoliciesExist(jpaToscaServiceTemplate);
         }).hasMessage("no policies specified on topology template of service template");
 
         jpaToscaServiceTemplate.getTopologyTemplate().setPolicies(new JpaToscaPolicies());
 
+        assertFalse(ToscaUtils.doPoliciesExist(jpaToscaServiceTemplate));
+        assertEquals("list of policies specified on topology template of service template is empty",
+                ToscaUtils.checkPoliciesExist(jpaToscaServiceTemplate));
         assertThatThrownBy(() -> {
             ToscaUtils.assertPoliciesExist(jpaToscaServiceTemplate);
         }).hasMessage("list of policies specified on topology template of service template is empty");
 
         jpaToscaServiceTemplate.getTopologyTemplate().getPolicies().getConceptMap().put(new PfConceptKey(), null);
 
+        assertTrue(ToscaUtils.doPoliciesExist(jpaToscaServiceTemplate));
+        assertEquals(null, ToscaUtils.checkPoliciesExist(jpaToscaServiceTemplate));
         assertThatCode(() -> {
             ToscaUtils.assertPoliciesExist(jpaToscaServiceTemplate);
         }).doesNotThrowAnyException();
