diff --git a/bin/smartdata/Backend.php b/bin/smartdata/Backend.php
index b69a98d7b51996a7ff557741ca0dabb00b4f530e..858d640b7e6d027a32b6c240c8e9145ab833d4fa 100644
--- a/bin/smartdata/Backend.php
+++ b/bin/smartdata/Backend.php
@@ -447,7 +447,6 @@ final class Credentials
 class Backend_V1_0 extends Backend_Common
 {
     // Create a new series if not exist
-    //public function create(Series $series) : bool {
     public function create($series) {
         $sucess = true;
         $parameters = array(':version'  => $series->version,
@@ -460,7 +459,8 @@ class Backend_V1_0 extends Backend_Common
                             ':t1'       => $series->t1,
                             ':domain'   => $this->_domain,
                             ':count'    => Config::config()::CASSANDRA_MAX_ROW_SIZE);
-        try {
+        try {    
+            Unit::validate( $series->unit );
             $conn = self::_mysqlConnect(Config::config()::MYSQL_SEVERNAME, Config::config()::MYSQL_PORT, Config::config()::MYSQL_DBNAME, Config::config()::MYSQL_USERNAME, Config::config()::MYSQL_PASSWORD);
             $table = Config::config()::MySQL_Table($series->version);
             $stmt_select = $conn->prepare("SELECT * FROM {$table} WHERE version = :version
@@ -1658,6 +1658,7 @@ class Backend_V1_1 extends Backend_Common
                             ':count'    => $series->count,
                             ':uncertainty' => $series->uncertainty);
         try {
+            Unit::validate( $series->unit );
             // As there can be OPEN series (with t0 = 0, waiting first event, or t1 = 99999999999999, wainting to be finished) NO new series should be created until they are closed.
             $conn = self::_mysqlConnect(Config::config()::MYSQL_SEVERNAME, Config::config()::MYSQL_PORT, Config::config()::MYSQL_DBNAME, Config::config()::MYSQL_USERNAME, Config::config()::MYSQL_PASSWORD);
             $table = Config::config()::MySQL_Table($series->version);
@@ -1776,9 +1777,8 @@ class Backend_V1_1 extends Backend_Common
                             ':type'      => $tracker->type ?? 'OLD');
 
         try {
-            if (!property_exists($tracker,"signature") || $tracker->signature === 0) {
-                throw new Exception\InternalException('Signature must be provided in Mobile SmartData.');
-            }
+            if (!property_exists($tracker,"signature") || $tracker->signature === 0) throw new Exception\InternalException('Signature must be provided in Mobile SmartData.');
+            Unit::validate( $tracker->unit );
             $conn = self::_mysqlConnect(Config::config()::MYSQL_SEVERNAME, Config::config()::MYSQL_PORT, Config::config()::MYSQL_DBNAME, Config::config()::MYSQL_USERNAME, Config::config()::MYSQL_PASSWORD);
             $table = Config::config()::MySQL_Table($tracker->version);
             $stmt_select = $conn->prepare("SELECT * FROM {$table} WHERE
diff --git a/bin/smartdata/SmartAPI.php b/bin/smartdata/SmartAPI.php
index 3864931bdd9c100f4ffad06ac10c4f406f7a8ad2..9ab795ba0ef467963be14e2f3029d248b1514d79 100644
--- a/bin/smartdata/SmartAPI.php
+++ b/bin/smartdata/SmartAPI.php
@@ -213,19 +213,13 @@ namespace SmartData\SmartAPI
     {
         $json = json_decode($content, false, 512, JSON_BIGINT_AS_STRING);
         $last_error = json_last_error();
-        if ($last_error === JSON_ERROR_NONE) {
-            list($credentials,$series,$params) = JsonAPI::parse_create($json);
-        } else {
-            list($credentials,$series,$params) = BinaryAPI::parse_create($content);
-        }
-        if ($series instanceof Series) {
-            $backend = new Backend($credentials);
-            if(!$backend->create($series, ...$params)) {
-                throw new CreationFailedException("Creation Failed");
-            } 
-        } else {
-            throw new BadRequestException("Error parsing content request: invalid series");
-        }
+
+        list($credentials,$series,$params) = ($last_error === JSON_ERROR_NONE) ? JsonAPI::parse_create($json) : BinaryAPI::parse_create($content);
+    
+        if ( ! $series instanceof Series) throw new BadRequestException("Error parsing content request: invalid series");
+        
+        $backend = new Backend($credentials);
+        if( ! $backend->create($series, ...$params) ) throw new CreationFailedException("Creation Failed");
     }
 
     function attach($content)
diff --git a/bin/smartdata/Unit.php b/bin/smartdata/Unit.php
index 68f2dec9528d4fdaa95d8465defb71cef7ccb640..ef3238bcc946ca129acd6ecfb52a6a9d9980c399 100644
--- a/bin/smartdata/Unit.php
+++ b/bin/smartdata/Unit.php
@@ -84,6 +84,16 @@ abstract class Unit
         return self::interpret(Unpack::uInt32($bin, true));
     }
 
+    public static function is_valid($u) : bool
+    {
+        return ( $u >= 0 || $u <= 4294967295 ) ;
+    }
+
+    public static function validate($u)
+    {
+        if ( ! self::is_valid($u) ) throw new Exception\InternalException("Unit value not allowed. Has to be [0~4294967295]");
+    }
+
     public static function is_digital_unit($u) : bool
     {
         return (($u & (1 << 31)) == self::DIGITAL);