Index: src/webapp/apigility/module/gnuboat_mapservice/Module.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/Module.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/Module.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,23 @@
+<?php
+namespace gnuboat_mapservice;
+
+use ZF\Apigility\Provider\ApigilityProviderInterface;
+
+class Module implements ApigilityProviderInterface
+{
+    public function getConfig()
+    {
+        return include __DIR__ . '/config/module.config.php';
+    }
+
+    public function getAutoloaderConfig()
+    {
+        return [
+            'ZF\Apigility\Autoloader' => [
+                'namespaces' => [
+                    __NAMESPACE__ => __DIR__ . '/src',
+                ],
+            ],
+        ];
+    }
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/config/module.config.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/config/module.config.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/config/module.config.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,260 @@
+<?php
+return [
+    'service_manager' => [
+        'factories' => [
+            \gnuboat_mapservice\V1\Rest\Upload\UploadResource::class => \gnuboat_mapservice\V1\Rest\Upload\UploadResourceFactory::class,
+            \gnuboat_mapservice\V1\Rest\Waters\WatersResource::class => \gnuboat_mapservice\V1\Rest\Waters\WatersResourceFactory::class,
+        ],
+    ],
+    'router' => [
+        'routes' => [
+            'gnuboat_mapservice.rest.upload' => [
+                'type' => 'Segment',
+                'options' => [
+                    'route' => '/upload[/:upload_id]',
+                    'defaults' => [
+                        'controller' => 'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller',
+                    ],
+                ],
+            ],
+            'gnuboat_mapservice.rest.waters' => [
+                'type' => 'Segment',
+                'options' => [
+                    'route' => '/waters[/:waters_id]',
+                    'defaults' => [
+                        'controller' => 'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller',
+                    ],
+                ],
+            ],
+        ],
+    ],
+    'zf-versioning' => [
+        'uri' => [
+            0 => 'gnuboat_mapservice.rest.upload',
+            1 => 'gnuboat_mapservice.rest.waters',
+        ],
+    ],
+    'zf-rest' => [
+        'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => [
+            'listener' => \gnuboat_mapservice\V1\Rest\Upload\UploadResource::class,
+            'route_name' => 'gnuboat_mapservice.rest.upload',
+            'route_identifier_name' => 'upload_id',
+            'collection_name' => 'upload',
+            'entity_http_methods' => [
+                0 => 'GET',
+                1 => 'PATCH',
+                2 => 'PUT',
+                3 => 'DELETE',
+            ],
+            'collection_http_methods' => [
+                0 => 'GET',
+                1 => 'POST',
+            ],
+            'collection_query_whitelist' => [],
+            'page_size' => 25,
+            'page_size_param' => null,
+            'entity_class' => \gnuboat_mapservice\V1\Rest\Upload\UploadEntity::class,
+            'collection_class' => \gnuboat_mapservice\V1\Rest\Upload\UploadCollection::class,
+            'service_name' => 'upload',
+        ],
+        'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
+            'listener' => \gnuboat_mapservice\V1\Rest\Waters\WatersResource::class,
+            'route_name' => 'gnuboat_mapservice.rest.waters',
+            'route_identifier_name' => 'waters_id',
+            'collection_name' => 'waters',
+            'entity_http_methods' => [
+                0 => 'GET',
+                1 => 'PATCH',
+                2 => 'PUT',
+                3 => 'DELETE',
+            ],
+            'collection_http_methods' => [
+                0 => 'GET',
+                1 => 'POST',
+            ],
+            'collection_query_whitelist' => [
+                0 => 'label',
+            ],
+            'page_size' => 25,
+            'page_size_param' => null,
+            'entity_class' => \gnuboat_mapservice\GnuBoat\MapService\Water::class,
+            'collection_class' => 'GnuBoat\\MapService\\WaterCollection',
+            'service_name' => 'waters',
+        ],
+    ],
+    'zf-content-negotiation' => [
+        'controllers' => [
+            'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => 'HalJson',
+            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => 'HalJson',
+        ],
+        'accept_whitelist' => [
+            'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => [
+                0 => 'application/vnd.gnuboat_mapservice.v1+json',
+                1 => 'application/hal+json',
+                2 => 'application/json',
+            ],
+            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
+                0 => 'application/vnd.gnuboat_mapservice.v1+json',
+                1 => 'application/hal+json',
+                2 => 'application/json',
+            ],
+        ],
+        'content_type_whitelist' => [
+            'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => [
+                0 => 'application/vnd.gnuboat_mapservice.v1+json',
+                1 => 'application/json',
+            ],
+            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
+                0 => 'application/vnd.gnuboat_mapservice.v1+json',
+                1 => 'application/json',
+            ],
+        ],
+    ],
+    'zf-hal' => [
+        'metadata_map' => [
+            \gnuboat_mapservice\V1\Rest\Upload\UploadEntity::class => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.upload',
+                'route_identifier_name' => 'upload_id',
+                'hydrator' => \Zend\Hydrator\ArraySerializable::class,
+            ],
+            \gnuboat_mapservice\V1\Rest\Upload\UploadCollection::class => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.upload',
+                'route_identifier_name' => 'upload_id',
+                'is_collection' => true,
+            ],
+            'gnuboat_mapservice\\V1\\Rest\\Waters\\WatersEntity' => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'hydrator' => \Zend\Hydrator\ArraySerializable::class,
+            ],
+            'gnuboat_mapservice\\V1\\Rest\\Waters\\WatersCollection' => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'is_collection' => true,
+            ],
+            \gnuboat_mapservice\GnuBoat\MapService\Water::class => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'hydrator' => \Zend\Hydrator\Reflection::class,
+            ],
+            \gnuboat_mapservice\GnuBoat\MapService\WaterCollection::class => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'is_collection' => true,
+            ],
+            'gnuboat_mapservice\\src\\GnuBoat\\MapService\\Water' => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'hydrator' => \Zend\Hydrator\Reflection::class,
+            ],
+            'gnuboat_mapservice\\src\\GnuBoat\\MapService\\WaterCollection' => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'is_collection' => true,
+            ],
+            'GnuBoat\\MapService\\Water' => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'hydrator' => \Zend\Hydrator\Reflection::class,
+            ],
+            'GnuBoat\\MapService\\WaterCollection' => [
+                'entity_identifier_name' => 'id',
+                'route_name' => 'gnuboat_mapservice.rest.waters',
+                'route_identifier_name' => 'waters_id',
+                'is_collection' => true,
+            ],
+        ],
+    ],
+    'zf-content-validation' => [
+        'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
+            'input_filter' => 'gnuboat_mapservice\\V1\\Rest\\Waters\\Validator',
+        ],
+    ],
+    'input_filter_specs' => [
+        'gnuboat_mapservice\\V1\\Rest\\Waters\\Validator' => [
+            0 => [
+                'required' => false,
+                'validators' => [
+                    0 => [
+                        'name' => \Zend\Validator\Digits::class,
+                        'options' => [],
+                    ],
+                ],
+                'filters' => [],
+                'name' => 'id',
+                'description' => 'Unique Identifier',
+                'field_type' => 'int',
+                'error_message' => 'The identifier of a water must be an integer.',
+            ],
+            1 => [
+                'required' => true,
+                'validators' => [],
+                'filters' => [
+                    0 => [
+                        'name' => \Zend\Filter\StringTrim::class,
+                        'options' => [],
+                    ],
+                ],
+                'name' => 'label',
+                'description' => 'Label of the water',
+                'error_message' => 'You must enter a Water name',
+            ],
+            2 => [
+                'required' => false,
+                'validators' => [
+                    0 => [
+                        'name' => \Zend\Validator\Digits::class,
+                        'options' => [],
+                    ],
+                ],
+                'filters' => [],
+                'name' => 'osm_id',
+                'description' => 'OpenStreetMap Id of the object',
+                'allow_empty' => true,
+            ],
+            3 => [
+                'required' => false,
+                'validators' => [],
+                'filters' => [
+                    0 => [
+                        'name' => \Zend\Filter\StringTrim::class,
+                        'options' => [],
+                    ],
+                ],
+                'name' => 'osm_type',
+                'description' => 'OpenStreetMap type of the object',
+                'field_type' => 'string',
+                'allow_empty' => true,
+            ],
+        ],
+    ],
+    'zf-mvc-auth' => [
+        'authorization' => [
+            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
+                'collection' => [
+                    'GET' => false,
+                    'POST' => true,
+                    'PUT' => false,
+                    'PATCH' => false,
+                    'DELETE' => false,
+                ],
+                'entity' => [
+                    'GET' => false,
+                    'POST' => false,
+                    'PUT' => true,
+                    'PATCH' => true,
+                    'DELETE' => true,
+                ],
+            ],
+        ],
+    ],
+];
Index: src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/Water.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/Water.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/Water.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,37 @@
+<?php
+/*
+    Copyright (C) 2019 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/>.
+*/
+
+namespace gnuboat_mapservice\GnuBoat\MapService;
+
+class Water
+{
+	public $waterId;
+	public $label;
+	public $osmId;
+	public $osmType;
+	public $osmClass;
+	
+	public function __construct(int $id, string $label, int $osm_id, string $osm_type, string $osm_class)
+	{
+		$this->waterId = $id;
+		$this->label = $label;
+		$this->osmId = $osm_id;
+		$this->osmType = $osm_type;
+		$this->osmClass = $osm_class;
+	}
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/WaterCollection.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/WaterCollection.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/WaterCollection.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,30 @@
+<?php
+/*
+    Copyright (C) 2019 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/>.
+*/
+
+namespace gnuboat_mapservice\GnuBoat\MapService;
+
+use Zend\Paginator\Paginator;
+use Zend\Paginator\Adapter;
+
+class WaterCollection extends Paginator
+{
+	public function __construct($waters, $waterHydrator)
+	{
+		parent::__construct(new Adapter\ArrayAdapter($waters));
+	}
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/WaterMapper.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/WaterMapper.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/WaterMapper.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,129 @@
+<?php
+/*
+    Copyright (C) 2019 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/>.
+*/
+
+namespace gnuboat_mapservice\GnuBoat\MapService;
+
+use Zend\Db\Sql as Sql;
+use Zend\Db\Sql\Where;
+use Zend\Db\Sql\Predicate\Like;
+use Zend\Db\Adapter\Driver\ResultInterface;
+use Zend\Db\ResultSet\HydratingResultSet;
+use ReflectionClass;
+use ZF\ApiProblem\ApiProblem;
+
+use gnuboat_mapservice\GnuBoat\MapService\WaterCollection as WaterCollection;
+
+class WaterMapper
+{
+	protected $database_adapter;
+	protected $hydrator;
+	
+	public function __construct($hydrator, $database_adapter)
+	{
+		$this->hydrator = $hydrator;
+		$this->database_adapter = $database_adapter;
+	}
+	
+	public function store($water)
+	{
+		$waters = $this->fetchByLabel($water->label);
+		if($waters){
+			if($waters->count() == 1){
+				return $this->hydrator->extract($waters->current());
+			}
+			elseif($waters->count() > 1){
+				/*return new ApiProblem(901, new WaterCollection($waters, $this->hydrator))*/;
+				return new ApiProblem(901, "Need to return found waters here!");
+			}
+		}
+		
+		$sql = new Sql\Sql($this->database_adapter);
+		$insert = $sql->insert("waters");
+		$insert->columns(['label', 'osm_id', 'osm_type']);
+		$insert->values([$water->label, $water->osmId, $water->osmType]);
+		$statement = $sql->getSqlStringForSqlObject($insert);
+		$results = $this->database_adapter->query($statement)->execute();
+
+		$waters = $this->fetchByLabel($water->label);
+		if($waters->count() < 1)
+			return new ApiProblem(500, "Should not happen in ". __CLASS__ .".". __METHOD__);
+		return $this->hydrator->extract($waters->current());
+	}
+	
+	public function fetch($params)
+	{
+		$sql = new Sql\Sql($this->database_adapter);
+		$select = $sql->select('waters');
+		
+		$where = new Where();
+		if(isset($params['label']) )
+			$where->like('label', '%'. $params['label'] .'%');
+		$select->where($where);
+		
+		$sqlQuery = $sql->getSqlStringForSqlObject($select);
+		$statement = $this->database_adapter->createStatement($sqlQuery);
+		$statement->prepare();
+		$results = $statement->execute();
+		$waters = $this->watersFromResult($results);
+		if(!$waters)
+			return new ApiProblem(500, "Could not fetch waters");
+		return new WaterCollection($waters->toArray(), $this->hydrator);
+	}
+	
+	public function fetchById($id)
+	{
+		$sql = new Sql\Sql($this->database_adapter);
+		$select = $sql->select('waters');
+		$select->where(['water_id' => $id]);
+		$sqlQuery = $sql->getSqlStringForSqlObject($select);
+		$statement = $this->database_adapter->createStatement($sqlQuery);
+		$statement->prepare();
+		$results = $statement->execute();
+		$waters = $this->watersFromResult($results);
+		if(!$waters || $waters->count() != 1)
+			return new ApiProblem(404, "Requested water not found");
+		return $this->hydrator->extract($waters->current());
+	}
+	
+	private function fetchByLabel($label)
+	{
+		$sql = new Sql\Sql($this->database_adapter);
+		$select = $sql->select('waters');
+		$select->where(['label' => $label]);
+		$statement = $sql->getSqlStringForSqlObject($select);
+		$results = $this->database_adapter->query($statement)->execute();
+		if($results->count() < 1)
+			return array();
+		return $this->watersFromResult($results);
+	}
+	
+	private function watersFromResult($dbResult)
+	{
+		if(!($dbResult instanceof ResultInterface)){
+			error_log("No instance of ResultInterface in ". __CLASS__ .".". __METHOD__);
+			return False;
+		}
+		if(!$dbResult->isQueryResult()){
+			error_log("No query result in ". __CLASS__ .".". __METHOD__);
+			return False;
+		}
+		$waters = new HydratingResultSet($this->hydrator, (new ReflectionClass(Water::class))->newInstanceWithoutConstructor());
+		$waters->initialize($dbResult);
+		return $waters;
+	}
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadCollection.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadCollection.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadCollection.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,8 @@
+<?php
+namespace gnuboat_mapservice\V1\Rest\Upload;
+
+use Zend\Paginator\Paginator;
+
+class UploadCollection extends Paginator
+{
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadEntity.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadEntity.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadEntity.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,6 @@
+<?php
+namespace gnuboat_mapservice\V1\Rest\Upload;
+
+class UploadEntity
+{
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadResource.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadResource.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadResource.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,109 @@
+<?php
+namespace gnuboat_mapservice\V1\Rest\Upload;
+
+use ZF\ApiProblem\ApiProblem;
+use ZF\Rest\AbstractResourceListener;
+
+class UploadResource extends AbstractResourceListener
+{
+    /**
+     * Create a resource
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function create($data)
+    {
+        return new ApiProblem(405, 'The POST method has not been defined');
+    }
+
+    /**
+     * Delete a resource
+     *
+     * @param  mixed $id
+     * @return ApiProblem|mixed
+     */
+    public function delete($id)
+    {
+        return new ApiProblem(405, 'The DELETE method has not been defined for individual resources');
+    }
+
+    /**
+     * Delete a collection, or members of a collection
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function deleteList($data)
+    {
+        return new ApiProblem(405, 'The DELETE method has not been defined for collections');
+    }
+
+    /**
+     * Fetch a resource
+     *
+     * @param  mixed $id
+     * @return ApiProblem|mixed
+     */
+    public function fetch($id)
+    {
+        return new ApiProblem(405, 'The GET method has not been defined for individual resources');
+    }
+
+    /**
+     * Fetch all or a subset of resources
+     *
+     * @param  array $params
+     * @return ApiProblem|mixed
+     */
+    public function fetchAll($params = [])
+    {
+        return new ApiProblem(405, 'The GET method has not been defined for collections');
+    }
+
+    /**
+     * Patch (partial in-place update) a resource
+     *
+     * @param  mixed $id
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function patch($id, $data)
+    {
+        return new ApiProblem(405, 'The PATCH method has not been defined for individual resources');
+    }
+
+    /**
+     * Patch (partial in-place update) a collection or members of a collection
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function patchList($data)
+    {
+        return new ApiProblem(405, 'The PATCH method has not been defined for collections');
+    }
+
+    /**
+     * Replace a collection or members of a collection
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function replaceList($data)
+    {
+        return new ApiProblem(405, 'The PUT method has not been defined for collections');
+    }
+
+    /**
+     * Update a resource
+     *
+     * @param  mixed $id
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function update($id, $data)
+    {
+        return new ApiProblem(405, 'The PUT method has not been defined for individual resources');
+    }
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadResourceFactory.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadResourceFactory.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Upload/UploadResourceFactory.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,10 @@
+<?php
+namespace gnuboat_mapservice\V1\Rest\Upload;
+
+class UploadResourceFactory
+{
+    public function __invoke($services)
+    {
+        return new UploadResource();
+    }
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Waters/WatersResource.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Waters/WatersResource.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Waters/WatersResource.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,146 @@
+<?php
+/*
+    Copyright (C) 2019 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/>.
+*/
+
+namespace gnuboat_mapservice\V1\Rest\Waters;
+
+use ZF\ApiProblem\ApiProblem;
+use ZF\Rest\AbstractResourceListener;
+use ReflectionClass;
+
+use gnuboat_mapservice\GnuBoat\MapService\Water as Water;
+use gnuboat_mapservice\GnuBoat\MapService\WaterCollection as WaterCollection;
+use gnuboat_mapservice\GnuBoat\MapService\WaterMapper as WaterMapper;
+
+class WatersResource extends AbstractResourceListener
+{
+	protected $hydrator;
+	protected $database_adapter;
+	protected $identity;
+	protected $mapperWater;
+
+	public function __construct($hydrator, $database_adapter, $identity)
+	{
+		$this->hydrator = $hydrator;
+		$this->database_adapter = $database_adapter;
+		$this->identity = $identity;
+		
+		$this->mapperWater = new WaterMapper($hydrator, $database_adapter);
+	}
+
+    /**
+     * Create a resource
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function create($data)
+    {
+		return $this->mapperWater->store($this->hydrator->hydrate(get_object_vars($data), (new ReflectionClass(Water::class))->newInstanceWithoutConstructor()));
+    }
+
+    /**
+     * Delete a resource
+     *
+     * @param  mixed $id
+     * @return ApiProblem|mixed
+     */
+    public function delete($id)
+    {
+        return new ApiProblem(405, 'The DELETE method has not been defined for individual resources');
+    }
+
+    /**
+     * Delete a collection, or members of a collection
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function deleteList($data)
+    {
+        return new ApiProblem(405, 'The DELETE method has not been defined for collections');
+    }
+
+    /**
+     * Fetch a resource
+     *
+     * @param  mixed $id
+     * @return ApiProblem|mixed
+     */
+    public function fetch($id)
+    {
+		return $this->mapperWater->fetchById($id);
+    }
+
+    /**
+     * Fetch all or a subset of resources
+     *
+     * @param  array $params
+     * @return ApiProblem|mixed
+     */
+    public function fetchAll($params = [])
+    {
+		error_log(print_r($params, True));
+		return $this->mapperWater->fetch($params);
+    }
+
+    /**
+     * Patch (partial in-place update) a resource
+     *
+     * @param  mixed $id
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function patch($id, $data)
+    {
+        return new ApiProblem(405, 'The PATCH method has not been defined for individual resources');
+    }
+
+    /**
+     * Patch (partial in-place update) a collection or members of a collection
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function patchList($data)
+    {
+        return new ApiProblem(405, 'The PATCH method has not been defined for collections');
+    }
+
+    /**
+     * Replace a collection or members of a collection
+     *
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function replaceList($data)
+    {
+        return new ApiProblem(405, 'The PUT method has not been defined for collections');
+    }
+
+    /**
+     * Update a resource
+     *
+     * @param  mixed $id
+     * @param  mixed $data
+     * @return ApiProblem|mixed
+     */
+    public function update($id, $data)
+    {
+        return new ApiProblem(405, 'The PUT method has not been defined for individual resources');
+    }
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Waters/WatersResourceFactory.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Waters/WatersResourceFactory.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/src/V1/Rest/Waters/WatersResourceFactory.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,40 @@
+<?php
+/*
+    Copyright (C) 2019 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/>.
+*/
+
+namespace gnuboat_mapservice\V1\Rest\Waters;
+
+use Zend\Hydrator\Reflection as ReflectionHydrator;
+use Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy as UnderscoreNamingStrategy;
+
+use Zend\Db\Adapter\AdapterInterface;
+
+class WatersResourceFactory
+{
+    public function __invoke($services)
+    {
+		$hydrator = new ReflectionHydrator();
+		// converts camelCase names into camel_case names and vice versa
+		$hydrator->setNamingStrategy(new UnderscoreNamingStrategy());
+    
+		$adapter = $services->get('gnuboat_mapservice_db');
+		
+		$identity = $services->get('api-identity');
+
+        return new WatersResource($hydrator, $adapter, $identity);
+    }
+}
Index: src/webapp/apigility/module/gnuboat_mapservice/test/V1/Rest/WatersTest.php
===================================================================
--- src/webapp/apigility/module/gnuboat_mapservice/test/V1/Rest/WatersTest.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
+++ src/webapp/apigility/module/gnuboat_mapservice/test/V1/Rest/WatersTest.php	(revision 74c3571b330568daeee1f4562299f3daae280ddf)
@@ -0,0 +1,96 @@
+<?php
+/*
+    Copyright (C) 2019 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/>.
+*/
+
+namespace gnuboat_mapservice\Test\V1\Rest;
+
+//  enable in php 7
+// declare(Strict_types=1);
+use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
+use Zend\Stdlib\ArrayUtils;
+use Zend\Http\Request;
+use Zend\Http\Headers;
+
+// use ApplicationTest\Bootstrap;
+use Zend\Mvc\Router\Http\TreeRouteStack as HttpRouter;
+use Application\Controller\IndexController;
+use Zend\Http\Request;
+use Zend\Http\Response;
+use Zend\Mvc\MvcEvent;
+use Zend\Mvc\Router\RouteMatch;
+use PHPUnit_Framework_TestCase;
+
+/**
+* @brief Covers Parser.php
+*/
+final class WatersTest extends AbstractHttpControllerTestCase
+{
+	protected $traceError = true;
+	
+	protected $controller;
+    protected $request;
+    protected $response;
+    protected $routeMatch;
+    protected $event;
+
+	public function setUp()
+    {
+// 		$configOverrides = [
+// 			'module_listener_options' => [
+// 				'config_cache_enabled' => false,
+// 			],
+// 		];
+// 
+// 		$this->setApplicationConfig(ArrayUtils::merge(
+// 			include __DIR__ . '/../../../../../config/application.config.php',
+// 			$configOverrides
+// 		));
+// 
+// 		parent::setUp();
+
+// 		$serviceManager = Bootstrap::getServiceManager();
+        $this->controller = new IndexController();
+        $this->request    = new Request();
+        $this->routeMatch = new RouteMatch(array('controller' => 'index'));
+        $this->event      = new MvcEvent();
+        $config = $serviceManager->get('Config');
+        $routerConfig = isset($config['router']) ? $config['router'] : array();
+        $router = HttpRouter::factory($routerConfig);
+
+        $this->event->setRouter($router);
+        $this->event->setRouteMatch($this->routeMatch);
+        $this->controller->setEvent($this->event);
+        $this->controller->setServiceLocator($serviceManager);
+	}
+
+    public function testWatersById()
+    {
+// 		$this->request = new \Zend\Http\Request();
+// 		$headers = new \Zend\Http\Headers;
+// 		$headers->addHeaderLine('Accept', 'application/json');
+// // 		$this->request->setHeaders($headers);
+//         $this->dispatch('/waters/1');
+//         $this->assertResponseStatusCode(200);
+// 
+//         $this->assertModuleName('application');
+//         $this->assertControllerName('application_index');
+//         $this->assertControllerClass('IndexController');
+//         $this->assertMatchedRouteName('home');
+    }
+}
+
+?>
