Index: src/lib/silibrary.h.in
===================================================================
--- src/lib/silibrary.h.in	(revision d83a844fd895d9307450f9858168930434e6cb58)
+++ src/lib/silibrary.h.in	(revision e4980702ba64d5e47a89bf5c21c5ba6da3f67eff)
@@ -41,4 +41,5 @@
 	namespace Library {
 		class SI_LIB_EXPORT Library {
+			public:
 			 static QString version();
 			 static QString geoCoordinateToString(double coordinate);
Index: src/webservice/htdocs/SiWeather/Webservice/Setup.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/Setup.php	(revision d83a844fd895d9307450f9858168930434e6cb58)
+++ src/webservice/htdocs/SiWeather/Webservice/Setup.php	(revision e4980702ba64d5e47a89bf5c21c5ba6da3f67eff)
@@ -251,4 +251,29 @@
 		}
 
+		// prepare status table
+		$table = "status";
+		if(!$this->databaseTableExists($table)){
+			$sql  = "CREATE TABLE ". $table ." (";
+			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
+			$sql .= "  name TEXT NOT NULL";
+			$sql .= ")";
+			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
+				return false;
+			}
+			$status = array("confirming", "active", "deletionrequested");
+			$sql  = "INSERT INTO ". $table ." (name) VALUES(:name)";
+			$sqlStatement = $this->_databaseHandler->prepare($sql);
+			foreach ($status as $name){
+				$sqlStatement->clear();
+				$sqlStatement->bindValue(":name", $name);
+				if(!$sqlStatement->execute()){
+					$errorMessage = Translation::swGettext("Could not add status %s to the database", $name);
+					error_log($errorMessage);
+					return false;
+				}
+				$sqlStatement->reset();
+			}
+		}
+
 		// prepare stations table
 		$table = "stations";
@@ -257,8 +282,12 @@
 			$sql .= "  id INTEGER NOT NULL PRIMARY KEY,";
 			$sql .= "  name TEXT NOT NULL,";
-			$sql .= "  city INTEGER,";
+			$sql .= "  city INTEGER NOT NULL,";
 			$sql .= "  uuid TEXT NOT NULL,";
 			$sql .= "  ownerMail TEXT NOT NULL,";
+			$sql .= "  type TEXT NOT NULL,";
+			$sql .= "  typeUrl TEXT,";
+			$sql .= "  status INTEGER NOT NULL,";
 			$sql .= "  FOREIGN KEY(city) REFERENCES cities(id)";
+			$sql .= "  FOREIGN KEY(status) REFERENCES status(id)";
 			$sql .= ")";
 			if(!$this->databaseTableCreate($table, $sql, $errorMessage)){
Index: src/webservice/htdocs/SiWeather/Webservice/WebserviceApi.php
===================================================================
--- src/webservice/htdocs/SiWeather/Webservice/WebserviceApi.php	(revision d83a844fd895d9307450f9858168930434e6cb58)
+++ src/webservice/htdocs/SiWeather/Webservice/WebserviceApi.php	(revision e4980702ba64d5e47a89bf5c21c5ba6da3f67eff)
@@ -121,5 +121,5 @@
 			}
 
-			$expectedKeys = array("name", "city", "longitude", "latitude", "email", "type", "typeUrl");
+			$expectedKeys = array("name", "city", "longitude", "latitude", "email", "type");
 			$missingKeys = array();
 			foreach($expectedKeys as $key){
@@ -164,4 +164,17 @@
 						"result" => "invalid email",
 						"message" => "Your specified an invalid email address: ". $json["email"],
+					]
+				);
+				return;
+			}
+			if(!array_key_exists("typeUrl", $json)){
+				$json["typeUrl"] = "";
+			}
+			elseif(!empty($json["typeUrl"]) && !filter_var($json["typeUrl"], FILTER_VALIDATE_URL)){
+				echo json_encode
+				(
+					[
+						"result" => "invalid type url",
+						"message" => "Your specified type url is invalid: ". $json["typeUrl"] ." Set it to an empty value or fix it.",
 					]
 				);
@@ -237,13 +250,12 @@
 			$sqlStatement->bindValue(":location", "POINT(". $location->locationWkt() .")");
 			$result = $sqlStatement->execute();
-			if($result->numColumns() && $result->columnType(0) != SQLITE3_NULL){
-				error_log("not cool");
-				$row = $result->fetchArray();
+			$row = $result->fetchArray();
+			if($row){
 				$cityId = $row[0];
-				error_log($row[0]);
 			}
 			else{
 				$sqlStatement = $db->prepare("INSERT INTO cities (name, location) VALUES(:name, GeomFromText(:location, 4326))");
 				if(!$sqlStatement){
+					error_log("Failed to add city to the database: ". $db->lastDatabaseErrorMessage());
 					$db->exec("ROLLBACK");
 					echo json_encode
@@ -273,5 +285,5 @@
 				$cityId = $db->lastInsertRowId();
 			}
-			if($cityId < 0){
+			if(!is_numeric($cityId) || $cityId < 0){
 				error_log("Failed to select city from the database: ". $db->lastDatabaseErrorMessage());
 				$db->exec("ROLLBACK");
@@ -286,7 +298,42 @@
 			}
 
+			// find out initial state
+			$statusId = -1;
+			$sqlStatement = $db->prepare("SELECT id FROM status WHERE name=:name");
+			if(!$sqlStatement){
+				$db->exec("ROLLBACK");
+				error_log("Could not find initial state to register station (Prepare): ". $db->lastDatabaseErrorMessage());
+				echo json_encode
+				(
+					[
+						"result" => "failed",
+						"message" => "Could not fetch status from database",
+					]
+				);
+				return;
+			}
+			$sqlStatement->bindValue(":name", "confirming");
+			$result = $sqlStatement->execute();
+			$row = $result->fetchArray();
+			if($row){
+				$statusId = $row[0];
+			}
+			else{
+				error_log("columns ". $result->numColumns() .", columnType: ". $result->columnType(0));
+				$db->exec("ROLLBACK");
+				error_log("Could not find initial state to register station (Execute): ". $db->lastDatabaseErrorMessage());
+				echo json_encode
+				(
+					[
+						"result" => "failed",
+						"message" => "Could not fetch status from database (Status not found)",
+					]
+				);
+				return;
+			}
+
 			// insert station
 			$uuid = uuid_create(4);
-			$sqlStatement = $db->prepare("INSERT INTO stations (name, city, uuid, ownerMail, location) VALUES(:name, :city, :uuid, :ownerMail, GeomFromText(:location, 4326))");
+			$sqlStatement = $db->prepare("INSERT INTO stations (name, city, uuid, ownerMail, type, typeUrl, status, location) VALUES(:name, :city, :uuid, :ownerMail, :type, :typeUrl, :status, GeomFromText(:location, 4326))");
 			if(!$sqlStatement){
 				$db->exec("ROLLBACK");
@@ -303,5 +350,8 @@
 			$sqlStatement->bindValue(":city", $cityId);
 			$sqlStatement->bindValue(":uuid", $uuid);
-			$sqlStatement->bindValue(":ownerMail",$json["email"]);
+			$sqlStatement->bindValue(":ownerMail", $json["email"]);
+			$sqlStatement->bindValue(":type", $json["type"]);
+			$sqlStatement->bindValue(":typeUrl", $json["typeUrl"]);
+			$sqlStatement->bindValue(":status", $statusId);
 			$sqlStatement->bindValue(":location", "POINT(". $location->locationWkt() .")");
 			$sqlResult = $sqlStatement->execute();
@@ -368,4 +418,5 @@
 				[
 					"result" => "success",
+					"message" => "Confirmation request is send to ". $json["email"] .".",
 					"uuid" => $uuid,
 				]
Index: src/webservice/tests/StationsTest.php
===================================================================
--- src/webservice/tests/StationsTest.php	(revision d83a844fd895d9307450f9858168930434e6cb58)
+++ src/webservice/tests/StationsTest.php	(revision e4980702ba64d5e47a89bf5c21c5ba6da3f67eff)
@@ -77,5 +77,5 @@
 		// sending must failing register request, caused by unproven location
 		$response = $client->post("index.php/stations/register",
-			[ "json" => ["name" => "Cool Station", "longitude" => 23.2, "latitude" => 90, "city" => "Nice town", "email" => "test@example.org"]]
+			[ "json" => ["name" => "Cool Station", "longitude" => 23.2, "latitude" => 90, "city" => "Nice town", "type" => "testing", "email" => "test@example.org"]]
 		);
 		$this->assertEquals($response->getStatusCode(), 200, $response->getReasonPhrase());
@@ -101,12 +101,14 @@
 
 		$response = $client->post("index.php/stations/register",
-			[ "json" => ["name" => "My Weather Station", "city" => "Clausthal-Zellerfeld", "longitude" => 10.28152, "latitude" => 51.8281, "email" => "test@example.org"]]
+			[ "json" => ["name" => "My Weather Station", "city" => "Clausthal-Zellerfeld", "longitude" => 10.28152, "latitude" => 51.8281, "type" => "testing", "email" => "test@example.org"]]
 		);
 		$this->assertEquals(200, $response->getStatusCode(), $response->getReasonPhrase());
 		$json = json_decode($response->getBody(), true);
 		$this->assertTrue(array_key_exists("result", $json));
-		$this->assertEquals("success", $json["result"]);
+		$this->assertEquals("success", $json["result"], $json["message"]);
 		$this->assertTrue(array_key_exists("uuid", $json));
 		$this->assertTrue(!empty($json["uuid"]));
+		$this->assertTrue(array_key_exists("message", $json));
+		$this->assertTrue(!empty($json["message"]));
 
 		$stations = $this->query("index.php/stations");
