Index: src/webapp/build.xml
===================================================================
--- src/webapp/build.xml	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/build.xml	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -73,13 +73,14 @@
 
 	<target name="test">
-		<phpunit bootstrap="webservice/inc/autoloader.php" pharlocation="phpunit-4.8.9.phar" haltonfailure="true" haltonerror="true" printsummary="true" codecoverage="false">
-			<formatter type="plain" usefile="false"/>
+		<exec command="php phpunit-4.8.9.phar" passthru="true" checkreturn="true"/>
+		<!--<phpunit pharlocation="phpunit-4.8.9.phar" configuration="phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true" codecoverage="false">
+			<formatter type="plain" usefile="false"/> -->
 			<!--<formatter type="JUnit" usefile="true"/>-->
-			<batchtest>
+<!--			<batchtest>
 				<fileset dir="webservice">
 					<include name="tests/*Test.php"/>
 				</fileset>
 			</batchtest>
-		</phpunit>
+		</phpunit>-->
 	</target>
 </project>
Index: src/webapp/phpunit.xml
===================================================================
--- src/webapp/phpunit.xml	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
+++ src/webapp/phpunit.xml	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="webservice/inc/autoloader.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="true"
+         stopOnFailure="true">
+    <testsuites>
+        <testsuite name="Webservice Tests">
+            <directory suffix="Test.php">./webservice/tests</directory>
+        </testsuite>
+    </testsuites>
+<!--    <filter>
+        <whitelist processUncoveredFilesFromWhitelist="true">
+            <directory suffix=".php">./app/Managers</directory>
+        </whitelist>
+    </filter>-->
+<!--    <php>
+        <env name="APP_ENV" value="testing"/>
+        <env name="CACHE_DRIVER" value="array"/>
+        <env name="SESSION_DRIVER" value="array"/>
+        <env name="QUEUE_DRIVER" value="sync"/>
+    </php>-->
+</phpunit>
Index: src/webapp/webservice/inc/GnuBoat/Service.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Service.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/Service.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -45,13 +45,32 @@
 	}
 	
-	public static function error($message)
+	public static function errorStatic($message, $additionalContent = array(), $debug)
 	{
-		Service::output(["error" => 1, "errormessage" => $message]);
+		error_log($message);
+		if($debug > 0)
+			print $message ."\n";
+		$result = ["error" => 1, "errormessage" => $message];
+		Service::outputStatic(array_merge($result, $additionalContent), $debug);
 	}
 	
-	public static function output($content)
+	public static function outputStatic($content, $debug)
 	{
 		header('Content-Type: application/json');
-		echo json_encode($content);
+		if($debug > 0){
+			echo json_encode($content,  JSON_PRETTY_PRINT) ."\n";
+		}
+		else{
+			echo json_encode($content) ."\n";
+		}
+	}
+	
+	protected function error($message, $additionalContent = array())
+	{
+		Service::errorStatic($message, $additionalContent, $this->debug());
+	}
+	
+	protected function output($content)
+	{
+		Service::outputStatic($content, $this->debug());
 	}
 
Index: src/webapp/webservice/inc/GnuBoat/ServiceData.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceData.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/ServiceData.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -29,8 +29,9 @@
 		$this->_configRound = array
 		(
-			"latitude" => 5,
-			"longitude" => 5,
+			"latitude" => 4,
+			"longitude" => 4,
 			"speedthroughwater" => 1,
 			"speedoverground" => 1,
+			"courseoverground" => 1,
 			"waterdepth" => 1,
 			"watertemperature" => 1,
@@ -48,14 +49,11 @@
 		$result["track"] = array();
 
-		if(!file_exists($dbFile)){
-			if($debug > 0)
-				echo "Database file ". $dbFile ." does not exist!";
-			error_log("Database file ". $dbFile ." does not exist");
-			return;
-		}
+		if(!file_exists($dbFile))
+			return $this->error("Database file ". $dbFile ." does not exist");
+
 		// Fetch entries of the last 30s with maximum (available) resolution of 2s
 		$this->addRrdData($dbFile, "2", "240", $result, $lastValid);
-		if($lastValid){
-			$result["lastvalid"] = $lastValid;
+		if($lastValid !== false){
+			$result["lastvalid"] = $lastValid->toArray();
 		}
 		// Fetch entries of the last 1h with maximum (available) resolution of 10s
@@ -64,11 +62,5 @@
 		$this->addRrdData($dbFile, "60", "86400", $result, $lastTime);
 
-		if($debug > 0){
-			echo json_encode($result,  JSON_PRETTY_PRINT) ."\n";
-		}
-		else{
-			header('Content-Type: application/json');
-			echo json_encode($result) ."\n";
-		}
+		return $this->output($result);
 	}
 
@@ -81,18 +73,9 @@
 		$data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", $startTime, "--end", $endTime));
 		// $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", "-". $period, "--end", "start+". $period, "--align-start"));
-		if($data === false){
-			echo json_encode($result);
-			$message = "Failure reading rrd database ". $dbFile .": ". rrd_error(); 
-			if($debug > 0)
-				echo $message;
-			else
-				error_log($message);
-			return;
-		}
+		if($data === false)
+			return $this->error("Failure reading rrd database ". $dbFile .": ". rrd_error(), $result); 
 
 		if($debug > 2){
-			echo "<pre>";
 			var_dump($data);
-			echo "</pre>";
 		}
 
@@ -101,54 +84,30 @@
 		// transform them into json format
 		$i = 0;
-		$lastValid = -1;
+		$lastValid = false;
 		$keys = array_keys($data);
 		$keyTimeframes = $keys[0];
 		$itemCount = count($keys);
-		if($itemCount < 0 ){
-			error_log("No keys in fetched rrd data from ". $dbFile);
-			echo json_encode("");
-			exit;
-		}
+		if($itemCount < 0 )
+			return $this->error("No keys in fetched rrd data from ". $dbFile);
+
 		$timeframesCount = count($data[$keyTimeframes]);
-		if($debug > 0){
-			echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
+		if($debug > 1){
+			error_log("Variables: ". $itemCount ."; Timeframes: ". $timeframesCount);
 		}
 		foreach($data[$keys[0]] as $timeframe => $value){
-			$allValid = true;
-			$gpsFix = false;
-			$tmp = array();
+			$tmp = new TrackItem($timeframe);
 			foreach($keys as $key){
-				if($key == "gpsfix"){
-					switch($data[$key][$timeframe]){
-						case 2:
-							$tmp[$key] = "2D";
-							$gpsFix = true;
-							break;
-						case 3:
-							$tmp[$key] = "3D";
-							$gpsFix = true;
-							break;
-						default:
-							$tmp[$key] = "-";
-					}
-				}
-				else{
-					$tmp[$key] = $data[$key][$timeframe];
-					if(!is_numeric($tmp[$key]) || is_nan($tmp[$key])){
-						$allValid = false;
-						if($debug > 1){
-							echo "Invalid value ". $key ." (". $tmp[$key] .") at time ". $timeframe ."<br/>";
-						}
-					}
-					elseif(array_key_exists($key, $this->_configRound) && is_integer($this->_configRound[$key]))
-						$tmp[$key] = round($tmp[$key], $this->_configRound[$key]);
-				}
+				$value = $data[$key][$timeframe];
+				if(array_key_exists($key, $this->_configRound) && is_integer($this->_configRound[$key]))
+					$value = round($value, $this->_configRound[$key]);
+				if(!$tmp->setProperty($key, $value) && $debug > 1)
+					error_log("Coult not set property ". $key ." to value ". $value ." at ". $timeframe);
 			}
 			// only add the timeframe to the track, if the values are valid and we had a gps fix at that time
-			if($allValid){
+			if($tmp->isValid()){
 				$lastValid = $tmp;
-				if($gpsFix){
+				if($tmp->gpsFixed()){
 					if(!array_key_exists($timeframe, $result["track"])){
-						$result["track"][$timeframe] = $tmp;
+						$result["track"][$timeframe] = $tmp->toArray();
 					}
 				}
Index: src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -39,70 +39,61 @@
 			$files = glob($config->logDirectory() ."*.log");
 			array_walk($files, 'GnuBoat\ServiceLogFiles::stripLogDirectory');
+			return $this->output($files);
+		}
 
-			header('Content-Type: application/json');
-			if($debug > 0){
-				echo json_encode($files,  JSON_PRETTY_PRINT) ."\n";
+		// prepare a download of available log files
+		$files = $_POST["logfilesSelected"];
+		if(count($files) < 1)
+			return $this->error("No logfile selected");
+		elseif(count($files) == 1){
+			$content = file_get_contents($config->logDirectory() . $files[0]);
+			if($content === false){
+				echo "<html><head></head><body>Failed to read logfile ". $files[0] ."</body></html>";
 			}
-			else{
-				echo json_encode($files) ."\n";
-			}
+		
+			header('Content-Type: text/plain');
+			header('Content-disposition: attachment; filename="'. $files[0] .'"');
+			header('Content-Length: ' . filesize($config->logDirectory() . $files[0]));
+			echo $content;
 		}
 		else{
-			// prepare a download of available log files
-			$files = $_POST["logfilesSelected"];
-			if(count($files) < 1){
+			$date = new \DateTime('NOW');
+			$archiveName = "gnuboat-logs-". $date->format("Y-m-d");
+		
+			// provide files as zip file
+			$tmpArchive = tempnam(sys_get_temp_dir(), $archiveName);
+			$zip = new \ZipArchive();
+			if($zip->open($tmpArchive, \ZipArchive::CREATE) !== TRUE){
+				echo "<html><head></head><body>Failed to create zip file</body></html>";
 				return;
 			}
-			elseif(count($files) == 1){
-				$content = file_get_contents($config->logDirectory() . $files[0]);
-				if($content === false){
-					echo "<html><head></head><body>Failed to read logfile ". $files[0] ."</body></html>";
-				}
-			
-				header('Content-Type: text/plain');
-				header('Content-disposition: attachment; filename="'. $files[0] .'"');
-				header('Content-Length: ' . filesize($config->logDirectory() . $files[0]));
-				echo $content;
-			}
-			else{
-				$date = new \DateTime('NOW');
-				$archiveName = "gnuboat-logs-". $date->format("Y-m-d");
-			
-				// provide files as zip file
-				$tmpArchive = tempnam(sys_get_temp_dir(), $archiveName);
-				$zip = new \ZipArchive();
-				if($zip->open($tmpArchive, \ZipArchive::CREATE) !== TRUE){
-					echo "<html><head></head><body>Failed to create zip file</body></html>";
+			foreach($files as $file){
+				if($zip->addFile($config->logDirectory() . $file, $archiveName ."/". $file) !== true){
+					$zip->close();
+					echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
 					return;
 				}
-				foreach($files as $file){
-					if($zip->addFile($config->logDirectory() . $file, $archiveName ."/". $file) !== true){
-						$zip->close();
-						echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
-						return;
-					}
-				}
-				if($zip->close() !== true){
-						echo "<html><head></head><body>Failed to save zip file</body></html>";
-						return;
-				}
-				
-				echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
-				
-				//Send zip folder
-				while (ob_get_level()) {
-					ob_end_clean();
-				}
-				ob_start();
-				header('Content-Type: application/zip');
-				header('Content-Transfer-Encoding: Binary');
-				header('Content-disposition: attachment; filename=' . $archiveName . '.zip');
-				header('Content-Length: ' . filesize($tmpArchive));
-				ob_flush();
-				ob_clean();
-				readfile($tmpArchive);
-				unlink($tmpArchive);
-				return;
 			}
+			if($zip->close() !== true){
+					echo "<html><head></head><body>Failed to save zip file</body></html>";
+					return;
+			}
+			
+			echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
+			
+			//Send zip folder
+			while (ob_get_level()) {
+				ob_end_clean();
+			}
+			ob_start();
+			header('Content-Type: application/zip');
+			header('Content-Transfer-Encoding: Binary');
+			header('Content-disposition: attachment; filename=' . $archiveName . '.zip');
+			header('Content-Length: ' . filesize($tmpArchive));
+			ob_flush();
+			ob_clean();
+			readfile($tmpArchive);
+			unlink($tmpArchive);
+			return;
 		}
 	}
Index: src/webapp/webservice/inc/GnuBoat/ServiceMap.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceMap.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/ServiceMap.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -30,80 +30,42 @@
 	protected function process()
 	{
-		header('Content-type: application/json');
+		if(!array_key_exists("mapName", $_POST))
+			return $this->error("Please specify map name (no value)");
 
-		$result["error"] = 1;
-		$result["errormessage"] = "Unknown Error";
-
-		if(!array_key_exists("mapName", $_POST)){
-			$result["error"] = 1;
-			$result["errormessage"] = "Please specify map name (no value)";
-			echo json_encode($result);
-			return;
-		}
 		$mapName = $_POST["mapName"];
-		if(empty($mapName) || $mapName == ""){
-			$result["error"] = 1;
-			$result["errormessage"] = "Please specifiy map name (empty value)";
-			echo json_encode($result);
-			return;
-		}
+		if(empty($mapName) || $mapName == "")
+			return $this->error("Please specifiy map name (empty value)");
 
 		$mapDirectory = __DIR__ ."/../../maps";
-		if(!array_key_exists("mapFile", $_FILES)){
-			$result["error"] = 1;
-			$result["errormessage"] = "No map file recieved";
-			echo json_encode($result);
-			return;
-		}
-		if (!isset($_FILES['mapFile']['error']) || is_array($_FILES['mapFile']['error'])){
-			$result["error"] = 1;
-			$result["errormessage"] = "Invalid parameters";
-			echo json_encode($result);
-			return;
-		}
+		if(!array_key_exists("mapFile", $_FILES))
+			return $this->error("No map file recieved");
+
+		if (!isset($_FILES['mapFile']['error']) || is_array($_FILES['mapFile']['error']))
+			return $this->error("Invalid parameters");
+
 		switch ($_FILES['mapFile']['error']) {
 			case UPLOAD_ERR_OK:
 				break;
 			case UPLOAD_ERR_NO_FILE:
-				$result["error"] = 1;
-				$result["errormessage"] = "No file sent";
-				echo json_encode($result);
-				return;
+				return $this->error("No file sent");
 			case UPLOAD_ERR_INI_SIZE:
 			case UPLOAD_ERR_FORM_SIZE:
-				$result["error"] = 1;
-				$result["errormessage"] = "Exceeded filesize limit.";
-				echo json_encode($result);
-				return;
+				return $this->error("Exceeded filesize limit.");
 			default:
-				$result["error"] = 1;
-				$result["errormessage"] = "Unknown PHP Error";
-				echo json_encode($result);
-				return;
+				return $this->error("Unknown PHP Error");
 		}
 		$mapFileName = $mapDirectory ."/". sha1_file($_FILES['mapFile']['tmp_name']) .".mbtiles";
 		if(move_uploaded_file($_FILES['mapFile']['tmp_name'], $mapFileName)){
-			if(!chmod($mapFileName, 0755)){
-				$result["error"] = 1;
-				$result["errormessage"] = "Could not change permissions of the map file";
-			}
-			else{
-				// correct map metadata
-				$resultRename = $this->setMapName($mapFileName, $mapName);
-				if($resultRename[0] === true){
-					$result["error"] = 0;
-					$result["errormessage"] = "";
-				}
-				else{
-					$result["error"] = 1;
-					$result["errormessage"] = $resultRename[1];
-				}
-			}
+			if(!chmod($mapFileName, 0755))
+				return $this->error("Could not change permissions of the map file");
+			// correct map metadata
+			$resultRename = $this->setMapName($mapFileName, $mapName);
+			if($resultRename[0] === true)
+				return $this->output(["error" => 0, "errormessage" => ""]);
+			
+			return $this->error($resultRename[1]);
 		}
-		else {
-			$result["error"] = 1;
-			$result["errormessage"] = "Could not move map in place";
-		}
-		echo json_encode($result);
+		else 
+			return $this->error("Could not move map in place");
 	}
 	
Index: src/webapp/webservice/inc/GnuBoat/ServiceShutdown.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceShutdown.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/ServiceShutdown.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -36,22 +36,13 @@
 		if($handle === false){
 			$message = "Could not create file (". $config->shutdownRequestFile() .") to indicate shutdown to the daemon.";
-			error_log($message);
-			$result["shutdownstart"] = -1;
-			$result["errormessage"] = $message;
-		}
-		else{
-			$shutdownTime = new \DateTime('NOW');
-			$shutdownTime->modify("+15 seconds");
-			fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
-			$result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
+			return $this->error($message, ["shutdownstart" => -1]);
 		}
 
-		header('Content-Type: application/json');
-		if($debug > 0){
-			echo json_encode($result,  JSON_PRETTY_PRINT) ."\n";
-		}
-		else{
-			echo json_encode($result) ."\n";
-		}
+		$shutdownTime = new \DateTime('NOW');
+		$shutdownTime->modify("+15 seconds");
+		fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
+		fclose($handle);
+		$result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
+		$this->output($result);
 	}
 }
Index: src/webapp/webservice/inc/GnuBoat/TrackItem.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/TrackItem.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/TrackItem.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -24,9 +24,9 @@
 class TrackItem
 {
-	function __construct()
-	{
-		$this->_time = null;
-		$this->_latitude = null;
-		$this->_longitude = null;
+	function __construct($timestamp = null, $latitude = null, $longitude = null)
+	{
+		$this->setTimestamp($timestamp);
+		$this->setLatitude($latitude);
+		$this->setLongitude($longitude);
 		$this->_speedThroughWater = null;
 		$this->_speedOverGround = null;
@@ -35,9 +35,47 @@
 		$this->_waterTemperature = null;
 		$this->_gpsfix = null;
-	}
-
+		
+		$this->_properties = [
+			"time" => ["timestamp", "setTimestamp"],
+			"latitude" => ["latitude", "setLatitude"],
+			"longitude" => ["longitude", "setLongitude"],
+			"speedthroughwater" => ["speedThroughWater", "setSpeedThroughWater"],
+			"speedoverground" => ["speedOverGround", "setSpeedOverGround"],
+			"courseoverground" => ["courseOverGround", "setCourseOverGround"],
+			"waterdepth" => ["waterDepth", "setWaterDepth"],
+			"watertemperature" => ["waterTemperature", "setWaterTemperature"],
+			"gpsfix" => ["gpsFix", "setGpsFix"],
+		];
+	}
+
+	public function hasProperty($property)
+	{
+		return array_key_exists(strtolower($property), $this->_properties);
+	}
+	
+	public function getProperty($property)
+	{
+		$property = strtolower($property);
+		if(!$this->hasProperty($property))
+			return null;
+		return call_user_func(array($this, $this->_properties[$property][0]));
+	}
+	
+	public function setProperty($property, $value)
+	{
+		$property = strtolower($property);
+		if(!$this->hasProperty($property))
+			return false;
+		return call_user_func(array($this, $this->_properties[$property][1]), $value);
+	}
+	
 	public function setTimestamp($time)
 	{
+		if(!is_numeric($time) || is_nan($time)){
+			$this->_time = null;
+			return false;
+		}
 		$this->_time = $time;
+		return true;
 	}
 	
@@ -45,8 +83,11 @@
 	{
 		$timezone = new \DateTimeZone("UTC");
-		if($dateTime == null)
+		if($dateTime == null){
 			$this->_time = null;
+			return true;
+		}
 		$dateTime->setTimezone($timezone);
 		$this->_time = $dateTime->getTimestamp();
+		return true;
 	}
 	
@@ -56,7 +97,12 @@
 	}
 	
-		public function setLatitude($latitude)
-	{
+	public function setLatitude($latitude)
+	{
+		if(!is_numeric($latitude) || is_nan($latitude)){
+			$this->_latitude = null;
+			return false;
+		}
 		$this->_latitude = $latitude;
+		return true;
 	}
 	
@@ -66,7 +112,12 @@
 	}
 	
-		public function setLongitude($longitude)
-	{
+	public function setLongitude($longitude)
+	{
+		if(!is_numeric($longitude) || is_nan($longitude)){
+			$this->_longitude = null;
+			return false;
+		}
 		$this->_longitude = $longitude;
+		return true;
 	}
 	
@@ -76,7 +127,12 @@
 	}
 	
-		public function setSpeedThroughWater($speedThroughWater)
-	{
+	public function setSpeedThroughWater($speedThroughWater)
+	{
+		if(!is_numeric($speedThroughWater) || is_nan($speedThroughWater)){
+			$this->_speedThroughWater = null;
+			return false;
+		}
 		$this->_speedThroughWater = $speedThroughWater;
+		return true;
 	}
 	
@@ -86,7 +142,12 @@
 	}
 	
-		public function setSpeedOverGround($speedOverGround)
-	{
+	public function setSpeedOverGround($speedOverGround)
+	{
+		if(!is_numeric($speedOverGround) || is_nan($speedOverGround)){
+			$this->_speedOverGround = null;
+			return false;
+		}
 		$this->_speedOverGround = $speedOverGround;
+		return true;
 	}
 	
@@ -96,7 +157,12 @@
 	}
 	
-		public function setCourseOverGround($courseOverGround)
-	{
+	public function setCourseOverGround($courseOverGround)
+	{
+		if(!is_numeric($courseOverGround) || is_nan($courseOverGround)){
+			$this->_courseOverGround = null;
+			return false;
+		}
 		$this->_courseOverGround = $courseOverGround;
+		return true;
 	}
 	
@@ -106,7 +172,12 @@
 	}
 	
-		public function setWaterDepth($waterDepth)
-	{
+	public function setWaterDepth($waterDepth)
+	{
+		if(!is_numeric($waterDepth) || is_nan($waterDepth)){
+			$this->_waterDepth = null;
+			return false;
+		}
 		$this->_waterDepth = $waterDepth;
+		return true;
 	}
 	
@@ -116,7 +187,12 @@
 	}
 	
-		public function setWaterTemperature($waterTemperature)
-	{
+	public function setWaterTemperature($waterTemperature)
+	{
+		if(!is_numeric($waterTemperature) || is_nan($waterTemperature)){
+			$this->_waterTemperature = null;
+			return false;
+		}
 		$this->_waterTemperature = $waterTemperature;
+		return true;
 	}
 	
@@ -126,7 +202,12 @@
 	}
 	
-		public function setGpsFix($gpsFix)
-	{
+	public function setGpsFix($gpsFix)
+	{
+		if(!is_numeric($gpsFix) || is_nan($gpsFix)){
+			$this->_gpsFix = null;
+			return false;
+		}
 		$this->_gpsFix = $gpsFix;
+		return true;
 	}
 	
@@ -136,4 +217,23 @@
 	}
 	
+	public function gpsFixString()
+	{
+		switch($this->gpsFix()){
+			case 2:
+				return "2D";
+			case 3:
+				return "3D";
+			default:
+				return "-";
+		}
+	}
+	
+	public function gpsFixed()
+	{
+		if($this->gpsFix() != null && $this->gpsFix() > 1)
+			return true;
+		return false;
+	}
+	
 	public function isValid()
 	{
@@ -149,10 +249,10 @@
 	public function toArray()
 	{
-		$speedThroughWater = ($this->speedThroughWater() != null) ? $this->speedThroughWater() : 0;
-		$speedOverGround = ($this->speedOverGround() != null) ? $this->speedOverGround() : 0;
-		$courseOverGround = ($this->courseOverGround() != null) ? $this->courseOverGround() : 0;
-		$waterDepth = ($this->waterDepth() != null) ? $this->waterDepth() : 0;
-		$waterTemperature = ($this->waterTemperature() != null) ? $this->waterTemperature() : 0;
-		$gpsFix = ($this->gpsFix() != null) ? $this->gpsFix() : 0;
+		$speedThroughWater = ($this->speedThroughWater() != null) ? $this->speedThroughWater() : "-";
+		$speedOverGround = ($this->speedOverGround() != null) ? $this->speedOverGround() : "-";
+		$courseOverGround = ($this->courseOverGround() != null) ? $this->courseOverGround() : "-";
+		$waterDepth = ($this->waterDepth() != null) ? $this->waterDepth() : "-";
+		$waterTemperature = ($this->waterTemperature() != null) ? $this->waterTemperature() : "-";
+		$gpsFix = $this->gpsFixString();
 	
 		return [
Index: src/webapp/webservice/inc/GnuBoat/Webservice.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Webservice.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/inc/GnuBoat/Webservice.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -43,5 +43,5 @@
 
 		if(!array_key_exists($request, $this->_requests)){
-			return Service::error("Request ". $request ." not implemented");
+			return Service::errorStatic("Request ". $request ." not implemented", $this->_debug);
 		}
 		
Index: src/webapp/webservice/tests/ServiceTest.php
===================================================================
--- src/webapp/webservice/tests/ServiceTest.php	(revision 89c510fdf91806e878ff9a0342d5b593186e23e3)
+++ src/webapp/webservice/tests/ServiceTest.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -50,5 +50,5 @@
 		$webservice->process();
 	}
-	
+
 	public function testMap()
 	{
@@ -58,5 +58,5 @@
 		$webservice->process();
 	}
-	
+
 	public function testReplay()
 	{
@@ -68,8 +68,8 @@
 }
 
-	function error_log($msg)
-	{
-		echo "ERR GnuBoat: ". $msg ."\n";
-	}
+function error_log($msg)
+{
+	echo "ERR GnuBoat: ". $msg ."\n";
+}
 
 ?>
Index: src/webapp/webservice/tests/TrackItemTest.php
===================================================================
--- src/webapp/webservice/tests/TrackItemTest.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
+++ src/webapp/webservice/tests/TrackItemTest.php	(revision 0662b2d2267145e004d2314d6a0ccad4e93628bd)
@@ -0,0 +1,90 @@
+<?php
+/*
+    Copyright (C) 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+//  enable in php 7
+// declare(Strict_types=1);
+
+/**
+  * @brief Covers Service.php tests
+  */
+final class TrackItemTest extends \PHPUnit_Framework_TestCase
+{
+	public function testConstructor()
+	{
+		$item = new GnuBoat\TrackItem();
+		$this->assertEquals(false, $item->isValid());
+		$this->assertNull($item->timestamp());
+		$this->assertNull($item->latitude());
+		$this->assertNull($item->longitude());
+		
+		$item = new GnuBoat\TrackItem(1, 2, 3);
+		$this->assertEquals(true, $item->isValid());
+		$this->assertEquals(1, $item->timestamp());
+		$this->assertEquals(2, $item->latitude());
+		$this->assertEquals(3, $item->longitude());
+	}
+
+	/**
+	 * @dataProvider propertiesProvider
+	 */
+	public function testProperties($property, $value, $result)
+	{
+		$item = new GnuBoat\TrackItem();
+		$this->assertNull($item->getProperty($property), "Not set property ". $property ." is not null");
+		$this->assertEquals($result, $item->setProperty($property, $value), "Could not set property ". $property);
+		if($result)
+			$this->assertEquals($value, $item->getProperty($property));
+		else
+			$this->assertNull($item->getProperty($property));
+	}
+	
+	public function propertiesProvider()
+	{
+		return [
+			["asdasd", "bla", false],
+			["TIME", time(), true],
+			["time", time(), true],
+			["time", "abc", false],
+			["latitude", 12.1, true],
+			["latitude", "abc", false],
+			["speedthroughwater", 12.1, true],
+			["speedthroughwater", "abc", false],
+			["courseoverground", 12.1, true],
+			["courseoverground", "abc", false],
+			["waterdepth", 12.1, true],
+			["waterdepth", "abc", false],
+			["watertemperature", 12.1, true],
+			["watertemperature", "abc", false],
+			["gpsfix", 12.1, true],
+			["gpsfix", "abc", false],
+		];
+	}
+	
+	public function testDateTime()
+	{
+		$item = new GnuBoat\TrackItem();
+		$this->assertNull($item->timestamp());
+		$dateTime = new DateTime();
+		$this->assertEquals(true, $item->setDateTime($dateTime));
+		$this->assertEquals($dateTime->getTimestamp(), $item->timestamp());
+		$this->assertEquals(true, $item->setDateTime(null));
+		$this->assertNull($item->timestamp());
+	}
+}
+
+?>
