Index: src/mapservice/codegen/code_generator
===================================================================
--- src/mapservice/codegen/code_generator	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/code_generator	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+DIR=`dirname "$0"`
+
+echo "Preparing symlinks"
+cd ${DIR}/../src-gen/openapi_server/
+if [ ! -L server_impl ]; then
+	ln -s ../../src/server_impl/
+fi
+
+echo "Copying static files"
+cp -a ../../src/templates ./
+cp -a ../../src/static ./
+mkdir -p static/css/
+mkdir -p static/js/
+mkdir -p static/resources/
+cp -a ../../../common/css/* static/css/
+cp -a ../../../common/js/* static/js/
+cp -a ../../../common/resources/* static/resources/
+cp -a ../../../../icon/gnuboat-256-256-transparent.png static/resources/
+
+cd ../../
+codegen/openapi-generator-cli generate -i openapi.yaml -g python-flask -t codegen/templates/ -o src-gen
+
+cd src-gen/
+python3 -m openapi_server
Index: src/mapservice/codegen/openapi-generator-cli
===================================================================
--- src/mapservice/codegen/openapi-generator-cli	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/openapi-generator-cli	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+####
+# Save as openapi-generator-cli on your PATH. chmod u+x. Enjoy.
+#
+# This script will query github on every invocation to pull the latest released version
+# of openapi-generator.
+#
+# If you want repeatable executions, you can explicitly set a version via
+#    OPENAPI_GENERATOR_VERSION
+# e.g. (in Bash)
+#    export OPENAPI_GENERATOR_VERSION=3.1.0
+#    openapi-generator-cli.sh
+# or
+#    OPENAPI_GENERATOR_VERSION=3.1.0 openapi-generator-cli.sh
+#
+# This is also helpful, for example, if you want want to evaluate a SNAPSHOT version.
+#
+# NOTE: Jars are downloaded on demand from maven into the same directory as this script
+# for every 'latest' version pulled from github. Consider putting this under its own directory.
+####
+set -o pipefail
+
+for cmd in {mvn,jq,curl}; do
+  if ! command -v ${cmd} > /dev/null; then
+  >&2 echo "This script requires '${cmd}' to be installed."
+    exit 1
+  fi
+done
+
+function latest.tag {
+  local uri="https://api.github.com/repos/${1}/releases"
+  local ver=$(curl -s ${uri} | jq -r 'first(.[]|select(.prerelease==false)).tag_name')
+  if [[ $ver == v* ]]; then
+    ver=${ver:1}
+  fi
+  echo $ver
+}
+
+ghrepo=openapitools/openapi-generator
+groupid=org.openapitools
+artifactid=openapi-generator-cli
+ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)}
+
+jar=${artifactid}-${ver}.jar
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ ! -f ${DIR}/${jar} ]; then
+  repo="central::default::https://repo1.maven.org/maven2/"
+  if [[ ${ver} =~ ^.*-SNAPSHOT$ ]]; then
+      repo="central::default::https://oss.sonatype.org/content/repositories/snapshots"
+  fi
+  mvn org.apache.maven.plugins:maven-dependency-plugin:2.9:get \
+    -DremoteRepositories=${repo} \
+    -Dartifact=${groupid}:${artifactid}:${ver} \
+    -Dtransitive=false \
+    -Ddest=${DIR}/${jar}
+fi
+
+java -ea                          \
+  ${JAVA_OPTS}                    \
+  -Xms512M                        \
+  -Xmx1024M                       \
+  -server                         \
+  -jar ${DIR}/${jar} "$@"
Index: src/mapservice/codegen/templates/Dockerfile.mustache
===================================================================
--- src/mapservice/codegen/templates/Dockerfile.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/Dockerfile.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,31 @@
+{{#supportPython2}}
+FROM python:2-alpine
+{{/supportPython2}}
+{{^supportPython2}}
+FROM python:3-alpine
+{{/supportPython2}}
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY requirements.txt /usr/src/app/
+
+{{#supportPython2}}
+RUN pip install --no-cache-dir -r requirements.txt
+{{/supportPython2}}
+{{^supportPython2}}
+RUN pip3 install --no-cache-dir -r requirements.txt
+{{/supportPython2}}
+
+COPY . /usr/src/app
+
+EXPOSE {{serverPort}}
+
+{{#supportPython2}}
+ENTRYPOINT ["python"]
+{{/supportPython2}}
+{{^supportPython2}}
+ENTRYPOINT ["python3"]
+{{/supportPython2}}
+
+CMD ["-m", "{{packageName}}"]
Index: src/mapservice/codegen/templates/README.mustache
===================================================================
--- src/mapservice/codegen/templates/README.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/README.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,60 @@
+# OpenAPI generated server
+
+## Overview
+This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the
+[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub.  This
+is an example of building a OpenAPI-enabled Flask server.
+
+This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask.
+
+## Requirements
+{{#supportPython2}}
+Python 2.7+
+{{/supportPython2}}
+{{^supportPython2}}
+Python 3.5.2+
+{{/supportPython2}}
+
+## Usage
+To run the server, please execute the following from the root directory:
+
+```
+{{#supportPython2}}
+pip install -r requirements.txt
+python -m {{packageName}}
+{{/supportPython2}}
+{{^supportPython2}}
+pip3 install -r requirements.txt
+python3 -m {{packageName}}
+{{/supportPython2}}
+```
+
+and open your browser to here:
+
+```
+http://localhost:{{serverPort}}{{contextPath}}/ui/
+```
+
+Your OpenAPI definition lives here:
+
+```
+http://localhost:{{serverPort}}{{contextPath}}/openapi.json
+```
+
+To launch the integration tests, use tox:
+```
+sudo pip install tox
+tox
+```
+
+## Running with Docker
+
+To run the server on a Docker container, please execute the following from the root directory:
+
+```bash
+# building the image
+docker build -t {{packageName}} .
+
+# starting up a container
+docker run -p {{serverPort}}:{{serverPort}} {{packageName}}
+```
Index: src/mapservice/codegen/templates/__init__model.mustache
===================================================================
--- src/mapservice/codegen/templates/__init__model.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/__init__model.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,7 @@
+# coding: utf-8
+
+# flake8: noqa
+from __future__ import absolute_import
+# import models into model package
+{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}}
+{{/models}}
Index: src/mapservice/codegen/templates/__init__test.mustache
===================================================================
--- src/mapservice/codegen/templates/__init__test.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/__init__test.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,16 @@
+import logging
+
+import connexion
+from flask_testing import TestCase
+
+from {{packageName}}.encoder import JSONEncoder
+
+
+class BaseTestCase(TestCase):
+
+    def create_app(self):
+        logging.getLogger('connexion.operation').setLevel('ERROR')
+        app = connexion.App(__name__, specification_dir='../openapi/')
+        app.app.json_encoder = JSONEncoder
+        app.add_api('openapi.yaml')
+        return app.app
Index: src/mapservice/codegen/templates/__main__.mustache
===================================================================
--- src/mapservice/codegen/templates/__main__.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/__main__.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,38 @@
+{{#supportPython2}}
+#!/usr/bin/env python
+{{/supportPython2}}
+{{^supportPython2}}
+#!/usr/bin/env python3
+{{/supportPython2}}
+
+import connexion
+from flask_cors import CORS
+from flask import render_template
+
+from {{packageName}} import encoder
+
+from {{packageName}}.server_impl.database.Model import db, User, ApiKey, db_test_setup
+
+app = connexion.App(__name__, specification_dir='./openapi/')
+application = app.app
+CORS(application)
+
+@application.before_first_request
+def create_database():
+	db_test_setup()
+
+@application.route("/mapservice/")
+def index():
+	return render_template('index.html')
+	
+def main():
+	application.json_encoder = encoder.JSONEncoder
+	app.add_api('openapi.yaml', arguments={'title': '{{appName}}'}, validate_responses=True)
+	application.config.from_object('{{packageName}}.server_impl.Config.DevelopmentConfig')
+
+	db.init_app(application)
+
+	app.run(port={{serverPort}})
+
+if __name__ == '__main__':
+	main()
Index: src/mapservice/codegen/templates/base_model_.mustache
===================================================================
--- src/mapservice/codegen/templates/base_model_.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/base_model_.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,73 @@
+import pprint
+
+import six
+{{^supportPython2}}
+import typing
+{{/supportPython2}}
+
+from {{packageName}} import util
+{{^supportPython2}}
+
+T = typing.TypeVar('T')
+{{/supportPython2}}
+
+
+class Model(object):
+    # openapiTypes: The key is attribute name and the
+    # value is attribute type.
+    openapi_types = {}
+
+    # attributeMap: The key is attribute name and the
+    # value is json key in definition.
+    attribute_map = {}
+
+    @classmethod
+    def from_dict(cls{{^supportPython2}}: typing.Type[T]{{/supportPython2}}, dikt){{^supportPython2}} -> T{{/supportPython2}}:
+        """Returns the dict as a model"""
+        return util.deserialize_model(dikt, cls)
+
+    def to_dict(self):
+        """Returns the model properties as a dict
+
+        :rtype: dict
+        """
+        result = {}
+
+        for attr, _ in six.iteritems(self.openapi_types):
+            value = getattr(self, attr)
+            if isinstance(value, list):
+                result[attr] = list(map(
+                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
+                    value
+                ))
+            elif hasattr(value, "to_dict"):
+                result[attr] = value.to_dict()
+            elif isinstance(value, dict):
+                result[attr] = dict(map(
+                    lambda item: (item[0], item[1].to_dict())
+                    if hasattr(item[1], "to_dict") else item,
+                    value.items()
+                ))
+            else:
+                result[attr] = value
+
+        return result
+
+    def to_str(self):
+        """Returns the string representation of the model
+
+        :rtype: str
+        """
+        return pprint.pformat(self.to_dict())
+
+    def __repr__(self):
+        """For `print` and `pprint`"""
+        return self.to_str()
+
+    def __eq__(self, other):
+        """Returns true if both objects are equal"""
+        return self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        """Returns true if both objects are not equal"""
+        return not self == other
Index: src/mapservice/codegen/templates/controller.mustache
===================================================================
--- src/mapservice/codegen/templates/controller.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/controller.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,113 @@
+import connexion
+import six
+
+{{#imports}}{{import}}  # noqa: E501
+{{/imports}}
+from {{packageName}} import util
+{{#operations}}
+{{#operation}}
+
+from {{packageName}}.server_impl.controllers import {{classname}}
+
+def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}):  # noqa: E501
+    """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}}
+
+    {{#notes}}{{.}}{{/notes}} # noqa: E501
+
+    {{#allParams}}
+    :param {{paramName}}: {{description}}
+        {{^isContainer}}
+            {{#isPrimitiveType}}
+    :type {{paramName}}: {{>param_type}}
+            {{/isPrimitiveType}}
+            {{#isUuid}}
+    :type {{paramName}}: {{>param_type}}
+            {{/isUuid}}
+            {{^isPrimitiveType}}
+                {{#isFile}}
+    :type {{paramName}}: werkzeug.datastructures.FileStorage
+                {{/isFile}}
+                {{^isFile}}
+                    {{^isUuid}}
+    :type {{paramName}}: dict | bytes
+                    {{/isUuid}}
+                {{/isFile}}
+            {{/isPrimitiveType}}
+        {{/isContainer}}
+        {{#isListContainer}}
+            {{#items}}
+                {{#isPrimitiveType}}
+    :type {{paramName}}: List[{{>param_type}}]
+                {{/isPrimitiveType}}
+                {{^isPrimitiveType}}
+    :type {{paramName}}: list | bytes
+                {{/isPrimitiveType}}
+            {{/items}}
+        {{/isListContainer}}
+        {{#isMapContainer}}
+            {{#items}}
+                {{#isPrimitiveType}}
+    :type {{paramName}}: Dict[str, {{>param_type}}]
+                {{/isPrimitiveType}}
+                {{^isPrimitiveType}}
+    :type {{paramName}}: dict | bytes
+                {{/isPrimitiveType}}
+            {{/items}}
+        {{/isMapContainer}}
+    {{/allParams}}
+
+    :rtype: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}None{{/returnType}}
+    """
+    {{#allParams}}
+        {{^isContainer}}
+            {{#isDate}}
+    {{paramName}} = util.deserialize_date({{paramName}})
+            {{/isDate}}
+            {{#isDateTime}}
+    {{paramName}} = util.deserialize_datetime({{paramName}})
+            {{/isDateTime}}
+            {{^isPrimitiveType}}
+                {{^isFile}}
+                    {{^isUuid}}
+    if connexion.request.is_json:
+        {{paramName}} = {{baseType}}.from_dict(connexion.request.get_json())  # noqa: E501
+                    {{/isUuid}}
+                {{/isFile}}
+            {{/isPrimitiveType}}
+        {{/isContainer}}
+        {{#isListContainer}}
+            {{#items}}
+                {{#isDate}}
+    if connexion.request.is_json:
+        {{paramName}} = [util.deserialize_date(s) for s in connexion.request.get_json()]  # noqa: E501
+                {{/isDate}}
+                {{#isDateTime}}
+    if connexion.request.is_json:
+        {{paramName}} = [util.deserialize_datetime(s) for s in connexion.request.get_json()]  # noqa: E501
+                {{/isDateTime}}
+                {{#complexType}}
+    if connexion.request.is_json:
+        {{paramName}} = [{{complexType}}.from_dict(d) for d in connexion.request.get_json()]  # noqa: E501
+                {{/complexType}}
+            {{/items}}
+        {{/isListContainer}}
+        {{#isMapContainer}}
+            {{#items}}
+                {{#isDate}}
+    if connexion.request.is_json:
+        {{paramName}} = {k: util.deserialize_date(v) for k, v in six.iteritems(connexion.request.get_json())}  # noqa: E501
+                {{/isDate}}
+                {{#isDateTime}}
+    if connexion.request.is_json:
+        {{paramName}} = {k: util.deserialize_datetime(v) for k, v in six.iteritems(connexion.request.get_json())}  # noqa: E501
+                {{/isDateTime}}
+                {{#complexType}}
+    if connexion.request.is_json:
+        {{paramName}} = {k: {{baseType}}.from_dict(v) for k, v in six.iteritems(connexion.request.get_json())}  # noqa: E501
+                {{/complexType}}
+            {{/items}}
+        {{/isMapContainer}}
+    {{/allParams}}
+    return {{classname}}.{{operationId}}({{#allParams}}{{paramName}}{{^required}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
+{{/operation}}
+{{/operations}}
Index: src/mapservice/codegen/templates/controller_test.mustache
===================================================================
--- src/mapservice/codegen/templates/controller_test.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/controller_test.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+import unittest
+
+from flask import json
+from six import BytesIO
+
+{{#imports}}{{import}}  # noqa: E501
+{{/imports}}
+from {{packageName}}.test import BaseTestCase
+
+
+class {{#operations}}Test{{classname}}(BaseTestCase):
+    """{{classname}} integration test stubs"""
+
+    {{#operation}}
+    {{#vendorExtensions.x-skip-test}}
+    @unittest.skip("{{reason}}")
+    {{/vendorExtensions.x-skip-test}}
+    def test_{{operationId}}(self):
+        """Test case for {{{operationId}}}
+
+        {{{summary}}}
+        """
+        {{#bodyParam}}
+        {{paramName}} = {{{example}}}
+        {{/bodyParam}}
+        {{#queryParams}}
+        {{#-first}}query_string = [{{/-first}}{{^-first}}                {{/-first}}('{{paramName}}', {{{example}}}){{#hasMore}},{{/hasMore}}{{#-last}}]{{/-last}}
+        {{/queryParams}}
+        headers = { {{#vendorExtensions.x-prefered-produce}}
+            'Accept': '{{mediaType}}',{{/vendorExtensions.x-prefered-produce}}{{#vendorExtensions.x-prefered-consume}}
+            'Content-Type': '{{mediaType}}',{{/vendorExtensions.x-prefered-consume}}{{#headerParams}}
+            '{{paramName}}': {{{example}}},{{/headerParams}}{{#authMethods}}
+            {{#isOAuth}}'Authorization': 'Bearer special-key',{{/isOAuth}}{{#isApiKey}}'{{name}}': 'special-key',{{/isApiKey}}{{#isBasicBasic}}'Authorization': 'BasicZm9vOmJhcg==',{{/isBasicBasic}}{{#isBasicBearer}}'Authorization': 'Bearer special-key',{{/isBasicBearer}}{{/authMethods}}
+        }
+        {{#formParams}}
+        {{#-first}}data = dict({{/-first}}{{^-first}}            {{/-first}}{{paramName}}={{{example}}}{{#hasMore}},{{/hasMore}}{{#-last}}){{/-last}}
+        {{/formParams}}
+        response = self.client.open(
+            '{{#contextPath}}{{{.}}}{{/contextPath}}{{{path}}}'{{#pathParams}}{{#-first}}.format({{/-first}}{{paramName}}={{{example}}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/pathParams}},
+            method='{{httpMethod}}',
+            headers=headers{{#bodyParam}},
+            data=json.dumps({{paramName}}){{^consumes}},
+            content_type='application/json'{{/consumes}}{{/bodyParam}}{{#formParams}}{{#-first}},
+            data=data{{/-first}}{{/formParams}}{{#consumes}}{{#-first}},
+            content_type='{{{mediaType}}}'{{/-first}}{{/consumes}}{{#queryParams}}{{#-first}},
+            query_string=query_string{{/-first}}{{/queryParams}})
+        self.assert200(response,
+                       'Response body is : ' + response.data.decode('utf-8'))
+
+   {{/operation}}
+{{/operations}}
+
+if __name__ == '__main__':
+    unittest.main()
Index: src/mapservice/codegen/templates/dockerignore.mustache
===================================================================
--- src/mapservice/codegen/templates/dockerignore.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/dockerignore.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,72 @@
+.travis.yaml
+.openapi-generator-ignore
+README.md
+tox.ini
+git_push.sh
+test-requirements.txt
+setup.py
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.python-version
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
Index: src/mapservice/codegen/templates/encoder.mustache
===================================================================
--- src/mapservice/codegen/templates/encoder.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/encoder.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,20 @@
+from connexion.apps.flask_app import FlaskJSONEncoder
+import six
+
+from {{modelPackage}}.base_model_ import Model
+
+
+class JSONEncoder(FlaskJSONEncoder):
+    include_nulls = False
+
+    def default(self, o):
+        if isinstance(o, Model):
+            dikt = {}
+            for attr, _ in six.iteritems(o.openapi_types):
+                value = getattr(o, attr)
+                if value is None and not self.include_nulls:
+                    continue
+                attr = o.attribute_map[attr]
+                dikt[attr] = value
+            return dikt
+        return FlaskJSONEncoder.default(self, o)
Index: src/mapservice/codegen/templates/git_push.sh.mustache
===================================================================
--- src/mapservice/codegen/templates/git_push.sh.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/git_push.sh.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+
+if [ "$git_user_id" = "" ]; then
+    git_user_id="{{{gitUserId}}}"
+    echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+    git_repo_id="{{{gitRepoId}}}"
+    echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+    release_note="{{{releaseNote}}}"
+    echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+    if [ "$GIT_TOKEN" = "" ]; then
+        echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+        git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+    else
+        git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+    fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
Index: src/mapservice/codegen/templates/gitignore.mustache
===================================================================
--- src/mapservice/codegen/templates/gitignore.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/gitignore.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,64 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.python-version
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
Index: src/mapservice/codegen/templates/model.mustache
===================================================================
--- src/mapservice/codegen/templates/model.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/model.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,169 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+from datetime import date, datetime  # noqa: F401
+
+from typing import List, Dict  # noqa: F401
+
+from {{modelPackage}}.base_model_ import Model
+{{#models}}
+{{#model}}
+{{#pyImports}}
+{{import}}
+{{/pyImports}}
+{{/model}}
+{{/models}}
+from {{packageName}} import util
+
+{{#imports}}
+{{{import}}}  # noqa: E501
+{{/imports}}
+
+{{#models}}
+{{#model}}
+class {{classname}}(Model):
+    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+
+    Do not edit the class manually.
+    """{{#allowableValues}}
+
+    """
+    allowed enum values
+    """
+{{#enumVars}}
+    {{name}} = {{{value}}}{{^-last}}
+{{/-last}}
+{{/enumVars}}{{/allowableValues}}
+
+    def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}):  # noqa: E501
+        """{{classname}} - a model defined in OpenAPI
+
+        {{#vars}}
+        :param {{name}}: The {{name}} of this {{classname}}.  # noqa: E501
+        :type {{name}}: {{dataType}}
+        {{/vars}}
+        """
+        self.openapi_types = {
+{{#vars}}
+            '{{name}}': {{{dataType}}}{{#hasMore}},{{/hasMore}}
+{{/vars}}
+        }
+
+        self.attribute_map = {
+{{#vars}}
+            '{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}}
+{{/vars}}
+        }
+{{#vars}}{{#-first}}
+{{/-first}}
+        self._{{name}} = {{name}}
+{{/vars}}
+
+    @classmethod
+    def from_dict(cls, dikt){{^supportPython2}} -> '{{classname}}'{{/supportPython2}}:
+        """Returns the dict as a model
+
+        :param dikt: A dict.
+        :type: dict
+        :return: The {{name}} of this {{classname}}.  # noqa: E501
+        :rtype: {{classname}}
+        """
+        return util.deserialize_model(dikt, cls){{#vars}}{{#-first}}
+
+{{/-first}}
+    @property
+    def {{name}}(self):
+        """Gets the {{name}} of this {{classname}}.
+
+        {{#description}}
+        {{{description}}}  # noqa: E501
+        {{/description}}
+
+        :return: The {{name}} of this {{classname}}.
+        :rtype: {{dataType}}
+        """
+        return self._{{name}}
+
+    @{{name}}.setter
+    def {{name}}(self, {{name}}):
+        """Sets the {{name}} of this {{classname}}.
+
+        {{#description}}
+        {{{description}}}  # noqa: E501
+        {{/description}}
+
+        :param {{name}}: The {{name}} of this {{classname}}.
+        :type {{name}}: {{dataType}}
+        """
+{{#isEnum}}
+        allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]  # noqa: E501
+{{#isContainer}}
+{{#isListContainer}}
+        if not set({{{name}}}).issubset(set(allowed_values)):
+            raise ValueError(
+                "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]"  # noqa: E501
+                .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))),  # noqa: E501
+                        ", ".join(map(str, allowed_values)))
+            )
+{{/isListContainer}}
+{{#isMapContainer}}
+        if not set({{{name}}}.keys()).issubset(set(allowed_values)):
+            raise ValueError(
+                "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]"  # noqa: E501
+                .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))),  # noqa: E501
+                        ", ".join(map(str, allowed_values)))
+            )
+{{/isMapContainer}}
+{{/isContainer}}
+{{^isContainer}}
+        if {{{name}}} not in allowed_values:
+            raise ValueError(
+                "Invalid value for `{{{name}}}` ({0}), must be one of {1}"
+                .format({{{name}}}, allowed_values)
+            )
+{{/isContainer}}
+{{/isEnum}}
+{{^isEnum}}
+{{#required}}
+        if {{name}} is None:
+            raise ValueError("Invalid value for `{{name}}`, must not be `None`")  # noqa: E501
+{{/required}}
+{{#hasValidation}}
+{{#maxLength}}
+        if {{name}} is not None and len({{name}}) > {{maxLength}}:
+            raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`")  # noqa: E501
+{{/maxLength}}
+{{#minLength}}
+        if {{name}} is not None and len({{name}}) < {{minLength}}:
+            raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`")  # noqa: E501
+{{/minLength}}
+{{#maximum}}
+        if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}:  # noqa: E501
+            raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`")  # noqa: E501
+{{/maximum}}
+{{#minimum}}
+        if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}:  # noqa: E501
+            raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`")  # noqa: E501
+{{/minimum}}
+{{#pattern}}
+        if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}):  # noqa: E501
+            raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`")  # noqa: E501
+{{/pattern}}
+{{#maxItems}}
+        if {{name}} is not None and len({{name}}) > {{maxItems}}:
+            raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`")  # noqa: E501
+{{/maxItems}}
+{{#minItems}}
+        if {{name}} is not None and len({{name}}) < {{minItems}}:
+            raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`")  # noqa: E501
+{{/minItems}}
+{{/hasValidation}}
+{{/isEnum}}
+
+        self._{{name}} = {{name}}{{^-last}}
+
+{{/-last}}
+{{/vars}}
+
+{{/model}}
+{{/models}}
Index: src/mapservice/codegen/templates/openapi.mustache
===================================================================
--- src/mapservice/codegen/templates/openapi.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/openapi.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,1 @@
+{{{openapi-yaml}}}
Index: src/mapservice/codegen/templates/param_type.mustache
===================================================================
--- src/mapservice/codegen/templates/param_type.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/param_type.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,1 @@
+{{#isString}}str{{/isString}}{{#isInteger}}int{{/isInteger}}{{#isLong}}int{{/isLong}}{{#isFloat}}float{{/isFloat}}{{#isDouble}}float{{/isDouble}}{{#isByteArray}}str{{/isByteArray}}{{#isBinary}}str{{/isBinary}}{{#isBoolean}}bool{{/isBoolean}}{{#isDate}}str{{/isDate}}{{#isDateTime}}str{{/isDateTime}}
Index: src/mapservice/codegen/templates/requirements.mustache
===================================================================
--- src/mapservice/codegen/templates/requirements.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/requirements.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,7 @@
+connexion == 2.0.2
+swagger-ui-bundle == 0.0.2
+python_dateutil == 2.6.0
+{{#supportPython2}}
+typing == 3.5.2.2
+{{/supportPython2}}
+setuptools >= 21.0.0
Index: src/mapservice/codegen/templates/security_controller_.mustache
===================================================================
--- src/mapservice/codegen/templates/security_controller_.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/security_controller_.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,90 @@
+from typing import List
+
+{{#authMethods}}
+{{#isOAuth}}
+
+def info_from_{{name}}(token):
+    """
+    Validate and decode token.
+    Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
+    'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
+    'scope' or 'scopes' will be passed to scope validation function.
+
+    :param token Token provided by Authorization header
+    :type token: str
+    :return: Decoded token information or None if token is invalid
+    :rtype: dict | None
+    """
+    return {'scopes': ['read:pets', 'write:pets'], 'uid': 'user_id'}
+
+
+def validate_scope_{{name}}(required_scopes, token_scopes):
+    """
+    Validate required scopes are included in token scope
+
+    :param required_scopes Required scope to access called API
+    :type required_scopes: List[str]
+    :param token_scopes Scope present in token
+    :type token_scopes: List[str]
+    :return: True if access to called API is allowed
+    :rtype: bool
+    """
+    return set(required_scopes).issubset(set(token_scopes))
+
+{{/isOAuth}}
+{{#isApiKey}}
+
+def info_from_{{name}}(api_key, required_scopes):
+    """
+    Check and retrieve authentication information from api_key.
+    Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
+    'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
+
+    :param api_key API key provided by Authorization header
+    :type api_key: str
+    :param required_scopes Always None. Used for other authentication method
+    :type required_scopes: None
+    :return: Information attached to provided api_key or None if api_key is invalid or does not allow access to called API
+    :rtype: dict | None
+    """
+    return {'uid': 'user_id'}
+
+{{/isApiKey}}
+{{#isBasicBasic}}
+
+def info_from_{{name}}(username, password, required_scopes):
+    """
+    Check and retrieve authentication information from basic auth.
+    Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
+    'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
+
+    :param username login provided by Authorization header
+    :type username: str
+    :param password password provided by Authorization header
+    :type password: str
+    :param required_scopes Always None. Used for other authentication method
+    :type required_scopes: None
+    :return: Information attached to user or None if credentials are invalid or does not allow access to called API
+    :rtype: dict | None
+    """
+    return {'uid': 'user_id'}
+
+{{/isBasicBasic}}
+{{#isBasicBearer}}
+
+def info_from_{{name}}(token):
+    """
+    Check and retrieve authentication information from custom bearer token.
+    Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
+    'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
+
+    :param token Token provided by Authorization header
+    :type token: str
+    :return: Decoded token information or None if token is invalid
+    :rtype: dict | None
+    """
+    return {'uid': 'user_id'}
+
+{{/isBasicBearer}}
+{{/authMethods}}
+
Index: src/mapservice/codegen/templates/setup.mustache
===================================================================
--- src/mapservice/codegen/templates/setup.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/setup.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+import sys
+from setuptools import setup, find_packages
+
+NAME = "{{packageName}}"
+VERSION = "{{packageVersion}}"
+{{#apiInfo}}{{#apis}}{{^hasMore}}
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+
+REQUIRES = [
+    "connexion==2.0.0",
+    "swagger-ui-bundle==0.0.2",
+    "python_dateutil==2.6.0"{{#supportPython2}},
+    "typing==3.5.2.2"{{/supportPython2}}
+]
+
+setup(
+    name=NAME,
+    version=VERSION,
+    description="{{appName}}",
+    author_email="{{infoEmail}}",
+    url="{{packageUrl}}",
+    keywords=["OpenAPI", "{{appName}}"],
+    install_requires=REQUIRES,
+    packages=find_packages(),
+    package_data={'': ['openapi/openapi.yaml']},
+    include_package_data=True,
+    entry_points={
+        'console_scripts': ['{{packageName}}={{packageName}}.__main__:main']},
+    long_description="""\
+    {{appDescription}}
+    """
+)
+{{/hasMore}}{{/apis}}{{/apiInfo}}
Index: src/mapservice/codegen/templates/test-requirements.mustache
===================================================================
--- src/mapservice/codegen/templates/test-requirements.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/test-requirements.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,6 @@
+flask_testing==0.6.1
+coverage>=4.0.3
+nose>=1.3.7
+pluggy>=0.3.1
+py>=1.4.31
+randomize>=0.13
Index: src/mapservice/codegen/templates/tox.mustache
===================================================================
--- src/mapservice/codegen/templates/tox.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/tox.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,10 @@
+[tox]
+envlist = {{#supportPython2}}py27, {{/supportPython2}}py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+     -r{toxinidir}/test-requirements.txt
+
+commands=
+   nosetests \
+      []
Index: src/mapservice/codegen/templates/travis.mustache
===================================================================
--- src/mapservice/codegen/templates/travis.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/travis.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,16 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+{{#supportPython2}}
+  - "2.7"
+{{/supportPython2}}
+  - "3.2"
+  - "3.3"
+  - "3.4"
+  - "3.5"
+  #- "3.5-dev" # 3.5 development branch
+  #- "nightly" # points to the latest development branch e.g. 3.6-dev
+# command to install dependencies
+install: "pip install -r requirements.txt"
+# command to run tests
+script: nosetests
Index: src/mapservice/codegen/templates/util.mustache
===================================================================
--- src/mapservice/codegen/templates/util.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/codegen/templates/util.mustache	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,141 @@
+import datetime
+
+import six
+import typing
+
+
+def _deserialize(data, klass):
+    """Deserializes dict, list, str into an object.
+
+    :param data: dict, list or str.
+    :param klass: class literal, or string of class name.
+
+    :return: object.
+    """
+    if data is None:
+        return None
+
+    if klass in six.integer_types or klass in (float, str, bool):
+        return _deserialize_primitive(data, klass)
+    elif klass == object:
+        return _deserialize_object(data)
+    elif klass == datetime.date:
+        return deserialize_date(data)
+    elif klass == datetime.datetime:
+        return deserialize_datetime(data)
+    elif type(klass) == typing.GenericMeta:
+        if klass.__extra__ == list:
+            return _deserialize_list(data, klass.__args__[0])
+        if klass.__extra__ == dict:
+            return _deserialize_dict(data, klass.__args__[1])
+    else:
+        return deserialize_model(data, klass)
+
+
+def _deserialize_primitive(data, klass):
+    """Deserializes to primitive type.
+
+    :param data: data to deserialize.
+    :param klass: class literal.
+
+    :return: int, long, float, str, bool.
+    :rtype: int | long | float | str | bool
+    """
+    try:
+        value = klass(data)
+    except UnicodeEncodeError:
+        value = six.u(data)
+    except TypeError:
+        value = data
+    return value
+
+
+def _deserialize_object(value):
+    """Return an original value.
+
+    :return: object.
+    """
+    return value
+
+
+def deserialize_date(string):
+    """Deserializes string to date.
+
+    :param string: str.
+    :type string: str
+    :return: date.
+    :rtype: date
+    """
+    try:
+        from dateutil.parser import parse
+        return parse(string).date()
+    except ImportError:
+        return string
+
+
+def deserialize_datetime(string):
+    """Deserializes string to datetime.
+
+    The string should be in iso8601 datetime format.
+
+    :param string: str.
+    :type string: str
+    :return: datetime.
+    :rtype: datetime
+    """
+    try:
+        from dateutil.parser import parse
+        return parse(string)
+    except ImportError:
+        return string
+
+
+def deserialize_model(data, klass):
+    """Deserializes list or dict to model.
+
+    :param data: dict, list.
+    :type data: dict | list
+    :param klass: class literal.
+    :return: model object.
+    """
+    instance = klass()
+
+    if not instance.openapi_types:
+        return data
+
+    for attr, attr_type in six.iteritems(instance.openapi_types):
+        if data is not None \
+                and instance.attribute_map[attr] in data \
+                and isinstance(data, (list, dict)):
+            value = data[instance.attribute_map[attr]]
+            setattr(instance, attr, _deserialize(value, attr_type))
+
+    return instance
+
+
+def _deserialize_list(data, boxed_type):
+    """Deserializes a list and its elements.
+
+    :param data: list to deserialize.
+    :type data: list
+    :param boxed_type: class literal.
+
+    :return: deserialized list.
+    :rtype: list
+    """
+    return [_deserialize(sub_data, boxed_type)
+            for sub_data in data]
+
+
+def _deserialize_dict(data, boxed_type):
+    """Deserializes a dict and its elements.
+
+    :param data: dict to deserialize.
+    :type data: dict
+    :param boxed_type: class literal.
+
+    :return: deserialized dict.
+    :rtype: dict
+    """
+    return {k: _deserialize(v, boxed_type)
+            for k, v in six.iteritems(data)}
Index: src/mapservice/openapi.yaml
===================================================================
--- src/mapservice/openapi.yaml	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/openapi.yaml	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,294 @@
+openapi: 3.0.0
+info:
+  title: GNUBoat Mapservice API
+  contact:
+    name: EngSaS - Engineering Solutions and Services Langenbach
+    url: 'http://www.engsas.com'
+    email: info@engsas.de
+  license:
+    name: GPL 3
+    url: 'https://www.gnu.org/licenses/gpl-3.0.en.html'
+  version: v1
+  description: API to upload log files with water depth to GNUBoat server
+servers:
+  - url: 'https://gnuboat.engsas.com/mapservice/{version}'
+    description: The production API server
+    variables:
+      version:
+        default: v1
+  - url: 'http://localhost:8080/mapservice/{version}'
+    description: The local flask development url
+    variables:
+      version:
+        default: v1
+paths:
+  /waters:
+    get:
+      description: Returns all waters
+      tags:
+        - waters
+      summary: Find waters by id
+      operationId: watersGet
+      parameters:
+        - name: name
+          in: header
+          schema:
+            $ref: '#/components/schemas/item_name'
+        - name: manager
+          in: header
+          schema:
+            $ref: '#/components/schemas/username'
+        - $ref: '#/components/parameters/orderBy'
+        - $ref: '#/components/parameters/offset'
+        - $ref: '#/components/parameters/limit'
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/waters'
+              examples:
+                Waters:
+                  $ref: '#/components/examples/waters'
+    post:
+      description: Adds a new water to the database
+      tags:
+        - waters
+      summary: Add a new water
+      security:
+        - basicAuth: []
+        - apiKeyAuth: []
+      requestBody:
+        description: item id of water is going to be ignored
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/WaterCreation'
+            examples:
+              Water:
+                $ref: '#/components/examples/WaterCreation'
+      responses:
+        '201':
+          description: Water created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Water'
+              examples:
+                Water:
+                  $ref: '#/components/examples/Water'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+  '/waters/{id}':
+    get:
+      description: Returns the water identified by id
+      tags:
+        - waters
+      summary: Represents a water
+      operationId: waterGetById
+      parameters:
+        - name: id
+          in: path
+          description: Item ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/item_id'
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Water'
+              examples:
+                Water:
+                  $ref: '#/components/examples/Water'
+        '404':
+          $ref: '#/components/responses/NotFound'
+components:
+  securitySchemes:
+    basicAuth:
+      type: http
+      scheme: basic
+      x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
+    apiKeyAuth:
+      type: apiKey
+      in: header
+      name: X-API-KEY
+      x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
+  schemas:
+    username:
+      title: Username
+      type: string
+    item_id:
+      title: Item ID
+      type: integer
+      format: int32
+    item_name:
+      title: Item Name
+      type: string
+    osm_type:
+      maxLength: 1
+      minLength: 1
+      type: string
+    Water:
+      title: Water
+      type: object
+      properties:
+        water_id:
+          $ref: '#/components/schemas/item_id'
+        name:
+          $ref: '#/components/schemas/item_name'
+        manager:
+          $ref: '#/components/schemas/username'
+        osm_id:
+          $ref: '#/components/schemas/item_id'
+        osm_type:
+          $ref: '#/components/schemas/osm_type'
+        osm_class:
+          $ref: '#/components/schemas/osm_type'
+      required:
+        - water_id
+        - name
+    WaterCreation:
+      title: Water
+      type: object
+      properties:
+        name:
+          $ref: '#/components/schemas/item_name'
+        osm_id:
+          $ref: '#/components/schemas/item_id'
+        osm_type:
+          $ref: '#/components/schemas/osm_type'
+      required:
+        - name
+    waters:
+      title: waters
+      type: array
+      items:
+        $ref: '#/components/schemas/Water'
+    order:
+      title: order
+      enum:
+        - desc
+        - asc
+      type: string
+      default: asc
+      description: |
+        Sort order:
+          * `asc` - Ascending, from A to Z
+          * `desc` - Descending, from Z to A
+      example: asc
+    HttpError:
+      title: HTTP Error Response Object
+      type: object
+      properties:
+        code:
+          type: integer
+        message:
+          type: string
+      required:
+        - code
+        - message
+  parameters:
+    orderBy:
+      name: orderBy
+      in: query
+      description: 'Order by field: name'
+      schema:
+        type: string
+        default: name
+    order:
+      name: order
+      in: query
+      description: Order
+      schema:
+        $ref: '#/components/schemas/order'
+    offset:
+      name: offset
+      in: query
+      description: >-
+        Skip over a number of elements by specifying an offset value for the
+        query
+      schema:
+        type: integer
+        format: int32
+        default: 0
+        example: 0
+    limit:
+      name: limit
+      in: query
+      description: Limit the number of elements on the response
+      style: form
+      explode: true
+      schema:
+        type: integer
+        format: int32
+        default: 10
+        example: 10
+  examples:
+    Water:
+      value:
+        water_id: 1
+        name: Mississippi
+        osm_id: 1756854
+        osm_type: R
+        link: 'http://gnuboat.engsas.com/mapservice/v1/waters/1'
+      summary: A water example object
+    WaterCreation:
+      value:
+        name: Mississippi
+        osm_id: 1756854
+        osm_type: R
+      summary: A water example object for creation of a water
+    waters:
+      value:
+        - water_id: 1
+          name: Mississippi
+          osm_id: 1756854
+          osm_type: R
+          link: 'http://gnuboat.engsas.com/mapservice/v1/waters/1'
+        - water_id: 2
+          name: Bodensee
+          link: 'http://gnuboat.engsas.com/mapservice/v1/waters/2'
+      summary: A sample list with waters
+    HttpError:
+      value:
+        code: 404
+        message: Water with id 999999 not found
+  responses:
+    BadRequest:
+      description: Bad Request (400)
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/HttpError'
+          examples:
+            HttpError:
+              $ref: '#/components/examples/HttpError'
+    Unauthorized:
+      description: Unauthorized (401) acces to resource
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/HttpError'
+          examples:
+            HttpError:
+              $ref: '#/components/examples/HttpError'
+    NotFound:
+      description: Water with given Id not found
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/HttpError'
+          examples:
+            HttpError:
+              $ref: '#/components/examples/HttpError'
+tags:
+  - name: waters
+    description: >-
+      A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North
+      Sea)
Index: src/mapservice/src-gen/.dockerignore
===================================================================
--- src/mapservice/src-gen/.dockerignore	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/.dockerignore	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,72 @@
+.travis.yaml
+.openapi-generator-ignore
+README.md
+tox.ini
+git_push.sh
+test-requirements.txt
+setup.py
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.python-version
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
Index: src/mapservice/src-gen/.gitignore
===================================================================
--- src/mapservice/src-gen/.gitignore	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/.gitignore	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,64 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.python-version
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
Index: src/mapservice/src-gen/.openapi-generator-ignore
===================================================================
--- src/mapservice/src-gen/.openapi-generator-ignore	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/.openapi-generator-ignore	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
Index: src/mapservice/src-gen/.openapi-generator/VERSION
===================================================================
--- src/mapservice/src-gen/.openapi-generator/VERSION	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/.openapi-generator/VERSION	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,1 @@
+3.3.4
Index: src/mapservice/src-gen/.travis.yml
===================================================================
--- src/mapservice/src-gen/.travis.yml	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/.travis.yml	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,13 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+  - "3.2"
+  - "3.3"
+  - "3.4"
+  - "3.5"
+  #- "3.5-dev" # 3.5 development branch
+  #- "nightly" # points to the latest development branch e.g. 3.6-dev
+# command to install dependencies
+install: "pip install -r requirements.txt"
+# command to run tests
+script: nosetests
Index: src/mapservice/src-gen/Dockerfile
===================================================================
--- src/mapservice/src-gen/Dockerfile	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/Dockerfile	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,16 @@
+FROM python:3-alpine
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+COPY requirements.txt /usr/src/app/
+
+RUN pip3 install --no-cache-dir -r requirements.txt
+
+COPY . /usr/src/app
+
+EXPOSE 8080
+
+ENTRYPOINT ["python3"]
+
+CMD ["-m", "openapi_server"]
Index: src/mapservice/src-gen/README.md
===================================================================
--- src/mapservice/src-gen/README.md	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/README.md	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,49 @@
+# OpenAPI generated server
+
+## Overview
+This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the
+[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub.  This
+is an example of building a OpenAPI-enabled Flask server.
+
+This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask.
+
+## Requirements
+Python 3.5.2+
+
+## Usage
+To run the server, please execute the following from the root directory:
+
+```
+pip3 install -r requirements.txt
+python3 -m openapi_server
+```
+
+and open your browser to here:
+
+```
+http://localhost:8080/mapservice/v1/ui/
+```
+
+Your OpenAPI definition lives here:
+
+```
+http://localhost:8080/mapservice/v1/openapi.json
+```
+
+To launch the integration tests, use tox:
+```
+sudo pip install tox
+tox
+```
+
+## Running with Docker
+
+To run the server on a Docker container, please execute the following from the root directory:
+
+```bash
+# building the image
+docker build -t openapi_server .
+
+# starting up a container
+docker run -p 8080:8080 openapi_server
+```
Index: src/mapservice/src-gen/git_push.sh
===================================================================
--- src/mapservice/src-gen/git_push.sh	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/git_push.sh	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+
+if [ "$git_user_id" = "" ]; then
+    git_user_id="GIT_USER_ID"
+    echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+    git_repo_id="GIT_REPO_ID"
+    echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+    release_note="Minor update"
+    echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+    if [ "$GIT_TOKEN" = "" ]; then
+        echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+        git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+    else
+        git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+    fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
Index: src/mapservice/src-gen/openapi_server/__main__.py
===================================================================
--- src/mapservice/src-gen/openapi_server/__main__.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/__main__.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+
+import connexion
+from flask_cors import CORS
+from flask import render_template
+
+from openapi_server import encoder
+
+from openapi_server.server_impl.database.Model import db, User, ApiKey, db_test_setup
+
+app = connexion.App(__name__, specification_dir='./openapi/')
+application = app.app
+CORS(application)
+
+@application.before_first_request
+def create_database():
+	db_test_setup()
+
+@application.route("/mapservice/")
+def index():
+	return render_template('index.html')
+	
+def main():
+	application.json_encoder = encoder.JSONEncoder
+	app.add_api('openapi.yaml', arguments={'title': 'GNUBoat Mapservice API'}, validate_responses=True)
+	application.config.from_object('openapi_server.server_impl.Config.DevelopmentConfig')
+
+	db.init_app(application)
+
+	app.run(port=8080)
+
+if __name__ == '__main__':
+	main()
Index: src/mapservice/src-gen/openapi_server/controllers/waters_controller.py
===================================================================
--- src/mapservice/src-gen/openapi_server/controllers/waters_controller.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/controllers/waters_controller.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,59 @@
+import connexion
+import six
+
+from openapi_server.models.http_error import HttpError  # noqa: E501
+from openapi_server.models.water import Water  # noqa: E501
+from openapi_server.models.water_creation import WaterCreation  # noqa: E501
+from openapi_server import util
+
+from openapi_server.server_impl.controllers import WatersController
+
+def water_get_by_id(id):  # noqa: E501
+    """Represents a water
+
+    Returns the water identified by id # noqa: E501
+
+    :param id: Item ID
+    :type id: int
+
+    :rtype: Water
+    """
+    return WatersController.water_get_by_id(id)
+
+from openapi_server.server_impl.controllers import WatersController
+
+def waters_get(name=None, manager=None, order_by=None, offset=None, limit=None):  # noqa: E501
+    """Find waters by id
+
+    Returns all waters # noqa: E501
+
+    :param name: 
+    :type name: str
+    :param manager: 
+    :type manager: str
+    :param order_by: Order by field: name
+    :type order_by: str
+    :param offset: Skip over a number of elements by specifying an offset value for the query
+    :type offset: int
+    :param limit: Limit the number of elements on the response
+    :type limit: int
+
+    :rtype: List[Water]
+    """
+    return WatersController.waters_get(name=name, manager=manager, order_by=order_by, offset=offset, limit=limit)
+
+from openapi_server.server_impl.controllers import WatersController
+
+def waters_post(water_creation=None):  # noqa: E501
+    """Add a new water
+
+    Adds a new water to the database # noqa: E501
+
+    :param water_creation: item id of water is going to be ignored
+    :type water_creation: dict | bytes
+
+    :rtype: Water
+    """
+    if connexion.request.is_json:
+        water_creation = WaterCreation.from_dict(connexion.request.get_json())  # noqa: E501
+    return WatersController.waters_post(water_creation=water_creation)
Index: src/mapservice/src-gen/openapi_server/encoder.py
===================================================================
--- src/mapservice/src-gen/openapi_server/encoder.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/encoder.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,20 @@
+from connexion.apps.flask_app import FlaskJSONEncoder
+import six
+
+from openapi_server.models.base_model_ import Model
+
+
+class JSONEncoder(FlaskJSONEncoder):
+    include_nulls = False
+
+    def default(self, o):
+        if isinstance(o, Model):
+            dikt = {}
+            for attr, _ in six.iteritems(o.openapi_types):
+                value = getattr(o, attr)
+                if value is None and not self.include_nulls:
+                    continue
+                attr = o.attribute_map[attr]
+                dikt[attr] = value
+            return dikt
+        return FlaskJSONEncoder.default(self, o)
Index: src/mapservice/src-gen/openapi_server/models/__init__.py
===================================================================
--- src/mapservice/src-gen/openapi_server/models/__init__.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/models/__init__.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,9 @@
+# coding: utf-8
+
+# flake8: noqa
+from __future__ import absolute_import
+# import models into model package
+from openapi_server.models.http_error import HttpError
+from openapi_server.models.order import Order
+from openapi_server.models.water import Water
+from openapi_server.models.water_creation import WaterCreation
Index: src/mapservice/src-gen/openapi_server/models/base_model_.py
===================================================================
--- src/mapservice/src-gen/openapi_server/models/base_model_.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/models/base_model_.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,69 @@
+import pprint
+
+import six
+import typing
+
+from openapi_server import util
+
+T = typing.TypeVar('T')
+
+
+class Model(object):
+    # openapiTypes: The key is attribute name and the
+    # value is attribute type.
+    openapi_types = {}
+
+    # attributeMap: The key is attribute name and the
+    # value is json key in definition.
+    attribute_map = {}
+
+    @classmethod
+    def from_dict(cls: typing.Type[T], dikt) -> T:
+        """Returns the dict as a model"""
+        return util.deserialize_model(dikt, cls)
+
+    def to_dict(self):
+        """Returns the model properties as a dict
+
+        :rtype: dict
+        """
+        result = {}
+
+        for attr, _ in six.iteritems(self.openapi_types):
+            value = getattr(self, attr)
+            if isinstance(value, list):
+                result[attr] = list(map(
+                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
+                    value
+                ))
+            elif hasattr(value, "to_dict"):
+                result[attr] = value.to_dict()
+            elif isinstance(value, dict):
+                result[attr] = dict(map(
+                    lambda item: (item[0], item[1].to_dict())
+                    if hasattr(item[1], "to_dict") else item,
+                    value.items()
+                ))
+            else:
+                result[attr] = value
+
+        return result
+
+    def to_str(self):
+        """Returns the string representation of the model
+
+        :rtype: str
+        """
+        return pprint.pformat(self.to_dict())
+
+    def __repr__(self):
+        """For `print` and `pprint`"""
+        return self.to_str()
+
+    def __eq__(self, other):
+        """Returns true if both objects are equal"""
+        return self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        """Returns true if both objects are not equal"""
+        return not self == other
Index: src/mapservice/src-gen/openapi_server/models/http_error.py
===================================================================
--- src/mapservice/src-gen/openapi_server/models/http_error.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/models/http_error.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+from datetime import date, datetime  # noqa: F401
+
+from typing import List, Dict  # noqa: F401
+
+from openapi_server.models.base_model_ import Model
+from openapi_server import util
+
+
+class HttpError(Model):
+    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+
+    Do not edit the class manually.
+    """
+
+    def __init__(self, code=None, message=None):  # noqa: E501
+        """HttpError - a model defined in OpenAPI
+
+        :param code: The code of this HttpError.  # noqa: E501
+        :type code: int
+        :param message: The message of this HttpError.  # noqa: E501
+        :type message: str
+        """
+        self.openapi_types = {
+            'code': int,
+            'message': str
+        }
+
+        self.attribute_map = {
+            'code': 'code',
+            'message': 'message'
+        }
+
+        self._code = code
+        self._message = message
+
+    @classmethod
+    def from_dict(cls, dikt) -> 'HttpError':
+        """Returns the dict as a model
+
+        :param dikt: A dict.
+        :type: dict
+        :return: The HttpError of this HttpError.  # noqa: E501
+        :rtype: HttpError
+        """
+        return util.deserialize_model(dikt, cls)
+
+    @property
+    def code(self):
+        """Gets the code of this HttpError.
+
+
+        :return: The code of this HttpError.
+        :rtype: int
+        """
+        return self._code
+
+    @code.setter
+    def code(self, code):
+        """Sets the code of this HttpError.
+
+
+        :param code: The code of this HttpError.
+        :type code: int
+        """
+        if code is None:
+            raise ValueError("Invalid value for `code`, must not be `None`")  # noqa: E501
+
+        self._code = code
+
+    @property
+    def message(self):
+        """Gets the message of this HttpError.
+
+
+        :return: The message of this HttpError.
+        :rtype: str
+        """
+        return self._message
+
+    @message.setter
+    def message(self, message):
+        """Sets the message of this HttpError.
+
+
+        :param message: The message of this HttpError.
+        :type message: str
+        """
+        if message is None:
+            raise ValueError("Invalid value for `message`, must not be `None`")  # noqa: E501
+
+        self._message = message
Index: src/mapservice/src-gen/openapi_server/models/order.py
===================================================================
--- src/mapservice/src-gen/openapi_server/models/order.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/models/order.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,43 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+from datetime import date, datetime  # noqa: F401
+
+from typing import List, Dict  # noqa: F401
+
+from openapi_server.models.base_model_ import Model
+from openapi_server import util
+
+
+class Order(Model):
+    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+
+    Do not edit the class manually.
+    """
+
+    """
+    allowed enum values
+    """
+    DESC = "desc"
+    ASC = "asc"
+
+    def __init__(self):  # noqa: E501
+        """Order - a model defined in OpenAPI
+
+        """
+        self.openapi_types = {
+        }
+
+        self.attribute_map = {
+        }
+
+    @classmethod
+    def from_dict(cls, dikt) -> 'Order':
+        """Returns the dict as a model
+
+        :param dikt: A dict.
+        :type: dict
+        :return: The order of this Order.  # noqa: E501
+        :rtype: Order
+        """
+        return util.deserialize_model(dikt, cls)
Index: src/mapservice/src-gen/openapi_server/models/water.py
===================================================================
--- src/mapservice/src-gen/openapi_server/models/water.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/models/water.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,206 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+from datetime import date, datetime  # noqa: F401
+
+from typing import List, Dict  # noqa: F401
+
+from openapi_server.models.base_model_ import Model
+from openapi_server import util
+
+
+class Water(Model):
+    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+
+    Do not edit the class manually.
+    """
+
+    def __init__(self, water_id=None, name=None, manager=None, osm_id=None, osm_type=None, osm_class=None):  # noqa: E501
+        """Water - a model defined in OpenAPI
+
+        :param water_id: The water_id of this Water.  # noqa: E501
+        :type water_id: int
+        :param name: The name of this Water.  # noqa: E501
+        :type name: str
+        :param manager: The manager of this Water.  # noqa: E501
+        :type manager: str
+        :param osm_id: The osm_id of this Water.  # noqa: E501
+        :type osm_id: int
+        :param osm_type: The osm_type of this Water.  # noqa: E501
+        :type osm_type: str
+        :param osm_class: The osm_class of this Water.  # noqa: E501
+        :type osm_class: str
+        """
+        self.openapi_types = {
+            'water_id': int,
+            'name': str,
+            'manager': str,
+            'osm_id': int,
+            'osm_type': str,
+            'osm_class': str
+        }
+
+        self.attribute_map = {
+            'water_id': 'water_id',
+            'name': 'name',
+            'manager': 'manager',
+            'osm_id': 'osm_id',
+            'osm_type': 'osm_type',
+            'osm_class': 'osm_class'
+        }
+
+        self._water_id = water_id
+        self._name = name
+        self._manager = manager
+        self._osm_id = osm_id
+        self._osm_type = osm_type
+        self._osm_class = osm_class
+
+    @classmethod
+    def from_dict(cls, dikt) -> 'Water':
+        """Returns the dict as a model
+
+        :param dikt: A dict.
+        :type: dict
+        :return: The Water of this Water.  # noqa: E501
+        :rtype: Water
+        """
+        return util.deserialize_model(dikt, cls)
+
+    @property
+    def water_id(self):
+        """Gets the water_id of this Water.
+
+
+        :return: The water_id of this Water.
+        :rtype: int
+        """
+        return self._water_id
+
+    @water_id.setter
+    def water_id(self, water_id):
+        """Sets the water_id of this Water.
+
+
+        :param water_id: The water_id of this Water.
+        :type water_id: int
+        """
+        if water_id is None:
+            raise ValueError("Invalid value for `water_id`, must not be `None`")  # noqa: E501
+
+        self._water_id = water_id
+
+    @property
+    def name(self):
+        """Gets the name of this Water.
+
+
+        :return: The name of this Water.
+        :rtype: str
+        """
+        return self._name
+
+    @name.setter
+    def name(self, name):
+        """Sets the name of this Water.
+
+
+        :param name: The name of this Water.
+        :type name: str
+        """
+        if name is None:
+            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
+
+        self._name = name
+
+    @property
+    def manager(self):
+        """Gets the manager of this Water.
+
+
+        :return: The manager of this Water.
+        :rtype: str
+        """
+        return self._manager
+
+    @manager.setter
+    def manager(self, manager):
+        """Sets the manager of this Water.
+
+
+        :param manager: The manager of this Water.
+        :type manager: str
+        """
+
+        self._manager = manager
+
+    @property
+    def osm_id(self):
+        """Gets the osm_id of this Water.
+
+
+        :return: The osm_id of this Water.
+        :rtype: int
+        """
+        return self._osm_id
+
+    @osm_id.setter
+    def osm_id(self, osm_id):
+        """Sets the osm_id of this Water.
+
+
+        :param osm_id: The osm_id of this Water.
+        :type osm_id: int
+        """
+
+        self._osm_id = osm_id
+
+    @property
+    def osm_type(self):
+        """Gets the osm_type of this Water.
+
+
+        :return: The osm_type of this Water.
+        :rtype: str
+        """
+        return self._osm_type
+
+    @osm_type.setter
+    def osm_type(self, osm_type):
+        """Sets the osm_type of this Water.
+
+
+        :param osm_type: The osm_type of this Water.
+        :type osm_type: str
+        """
+        if osm_type is not None and len(osm_type) > 1:
+            raise ValueError("Invalid value for `osm_type`, length must be less than or equal to `1`")  # noqa: E501
+        if osm_type is not None and len(osm_type) < 1:
+            raise ValueError("Invalid value for `osm_type`, length must be greater than or equal to `1`")  # noqa: E501
+
+        self._osm_type = osm_type
+
+    @property
+    def osm_class(self):
+        """Gets the osm_class of this Water.
+
+
+        :return: The osm_class of this Water.
+        :rtype: str
+        """
+        return self._osm_class
+
+    @osm_class.setter
+    def osm_class(self, osm_class):
+        """Sets the osm_class of this Water.
+
+
+        :param osm_class: The osm_class of this Water.
+        :type osm_class: str
+        """
+        if osm_class is not None and len(osm_class) > 1:
+            raise ValueError("Invalid value for `osm_class`, length must be less than or equal to `1`")  # noqa: E501
+        if osm_class is not None and len(osm_class) < 1:
+            raise ValueError("Invalid value for `osm_class`, length must be greater than or equal to `1`")  # noqa: E501
+
+        self._osm_class = osm_class
Index: src/mapservice/src-gen/openapi_server/models/water_creation.py
===================================================================
--- src/mapservice/src-gen/openapi_server/models/water_creation.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/models/water_creation.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,122 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+from datetime import date, datetime  # noqa: F401
+
+from typing import List, Dict  # noqa: F401
+
+from openapi_server.models.base_model_ import Model
+from openapi_server import util
+
+
+class WaterCreation(Model):
+    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+
+    Do not edit the class manually.
+    """
+
+    def __init__(self, name=None, osm_id=None, osm_type=None):  # noqa: E501
+        """WaterCreation - a model defined in OpenAPI
+
+        :param name: The name of this WaterCreation.  # noqa: E501
+        :type name: str
+        :param osm_id: The osm_id of this WaterCreation.  # noqa: E501
+        :type osm_id: int
+        :param osm_type: The osm_type of this WaterCreation.  # noqa: E501
+        :type osm_type: str
+        """
+        self.openapi_types = {
+            'name': str,
+            'osm_id': int,
+            'osm_type': str
+        }
+
+        self.attribute_map = {
+            'name': 'name',
+            'osm_id': 'osm_id',
+            'osm_type': 'osm_type'
+        }
+
+        self._name = name
+        self._osm_id = osm_id
+        self._osm_type = osm_type
+
+    @classmethod
+    def from_dict(cls, dikt) -> 'WaterCreation':
+        """Returns the dict as a model
+
+        :param dikt: A dict.
+        :type: dict
+        :return: The WaterCreation of this WaterCreation.  # noqa: E501
+        :rtype: WaterCreation
+        """
+        return util.deserialize_model(dikt, cls)
+
+    @property
+    def name(self):
+        """Gets the name of this WaterCreation.
+
+
+        :return: The name of this WaterCreation.
+        :rtype: str
+        """
+        return self._name
+
+    @name.setter
+    def name(self, name):
+        """Sets the name of this WaterCreation.
+
+
+        :param name: The name of this WaterCreation.
+        :type name: str
+        """
+        if name is None:
+            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
+
+        self._name = name
+
+    @property
+    def osm_id(self):
+        """Gets the osm_id of this WaterCreation.
+
+
+        :return: The osm_id of this WaterCreation.
+        :rtype: int
+        """
+        return self._osm_id
+
+    @osm_id.setter
+    def osm_id(self, osm_id):
+        """Sets the osm_id of this WaterCreation.
+
+
+        :param osm_id: The osm_id of this WaterCreation.
+        :type osm_id: int
+        """
+
+        self._osm_id = osm_id
+
+    @property
+    def osm_type(self):
+        """Gets the osm_type of this WaterCreation.
+
+
+        :return: The osm_type of this WaterCreation.
+        :rtype: str
+        """
+        return self._osm_type
+
+    @osm_type.setter
+    def osm_type(self, osm_type):
+        """Sets the osm_type of this WaterCreation.
+
+
+        :param osm_type: The osm_type of this WaterCreation.
+        :type osm_type: str
+        """
+        if osm_type is not None and len(osm_type) > 1:
+            raise ValueError("Invalid value for `osm_type`, length must be less than or equal to `1`")  # noqa: E501
+        if osm_type is not None and len(osm_type) < 1:
+            raise ValueError("Invalid value for `osm_type`, length must be greater than or equal to `1`")  # noqa: E501
+
+        self._osm_type = osm_type
Index: src/mapservice/src-gen/openapi_server/openapi/openapi.yaml
===================================================================
--- src/mapservice/src-gen/openapi_server/openapi/openapi.yaml	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/openapi/openapi.yaml	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,388 @@
+openapi: 3.0.0
+info:
+  contact:
+    email: info@engsas.de
+    name: EngSaS - Engineering Solutions and Services Langenbach
+    url: http://www.engsas.com
+  description: API to upload log files with water depth to GNUBoat server
+  license:
+    name: GPL 3
+    url: https://www.gnu.org/licenses/gpl-3.0.en.html
+  title: GNUBoat Mapservice API
+  version: v1
+servers:
+- description: The production API server
+  url: https://gnuboat.engsas.com/mapservice/{version}
+  variables:
+    version:
+      default: v1
+- description: The local flask development url
+  url: http://localhost:8080/mapservice/{version}
+  variables:
+    version:
+      default: v1
+tags:
+- description: A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North Sea)
+  name: waters
+paths:
+  /waters:
+    get:
+      description: Returns all waters
+      operationId: waters_get
+      parameters:
+      - explode: false
+        in: header
+        name: name
+        required: false
+        schema:
+          $ref: '#/components/schemas/item_name'
+        style: simple
+      - explode: false
+        in: header
+        name: manager
+        required: false
+        schema:
+          $ref: '#/components/schemas/username'
+        style: simple
+      - description: 'Order by field: name'
+        explode: true
+        in: query
+        name: orderBy
+        required: false
+        schema:
+          default: name
+          type: string
+        style: form
+      - description: Skip over a number of elements by specifying an offset value for the query
+        explode: true
+        in: query
+        name: offset
+        required: false
+        schema:
+          default: 0
+          example: 0
+          format: int32
+          type: integer
+        style: form
+      - description: Limit the number of elements on the response
+        explode: true
+        in: query
+        name: limit
+        required: false
+        schema:
+          default: 10
+          example: 10
+          format: int32
+          type: integer
+        style: form
+      responses:
+        200:
+          content:
+            application/json:
+              examples:
+                Waters:
+                  $ref: '#/components/examples/waters'
+              schema:
+                $ref: '#/components/schemas/waters'
+          description: OK
+      summary: Find waters by id
+      tags:
+      - waters
+      x-openapi-router-controller: openapi_server.controllers.waters_controller
+    post:
+      description: Adds a new water to the database
+      operationId: waters_post
+      requestBody:
+        content:
+          application/json:
+            examples:
+              Water:
+                $ref: '#/components/examples/WaterCreation'
+            schema:
+              $ref: '#/components/schemas/WaterCreation'
+        description: item id of water is going to be ignored
+      responses:
+        201:
+          content:
+            application/json:
+              examples:
+                Water:
+                  $ref: '#/components/examples/Water'
+              schema:
+                $ref: '#/components/schemas/Water'
+          description: Water created
+        400:
+          content:
+            application/json:
+              examples:
+                HttpError:
+                  $ref: '#/components/examples/HttpError'
+              schema:
+                $ref: '#/components/schemas/HttpError'
+          description: Bad Request (400)
+        401:
+          content:
+            application/json:
+              examples:
+                HttpError:
+                  $ref: '#/components/examples/HttpError'
+              schema:
+                $ref: '#/components/schemas/HttpError'
+          description: Unauthorized (401) acces to resource
+      security:
+      - basicAuth: []
+      - apiKeyAuth: []
+      summary: Add a new water
+      tags:
+      - waters
+      x-openapi-router-controller: openapi_server.controllers.waters_controller
+  /waters/{id}:
+    get:
+      description: Returns the water identified by id
+      operationId: water_get_by_id
+      parameters:
+      - description: Item ID
+        explode: false
+        in: path
+        name: id
+        required: true
+        schema:
+          $ref: '#/components/schemas/item_id'
+        style: simple
+      responses:
+        200:
+          content:
+            application/json:
+              examples:
+                Water:
+                  $ref: '#/components/examples/Water'
+              schema:
+                $ref: '#/components/schemas/Water'
+          description: OK
+        404:
+          content:
+            application/json:
+              examples:
+                HttpError:
+                  $ref: '#/components/examples/HttpError'
+              schema:
+                $ref: '#/components/schemas/HttpError'
+          description: Water with given Id not found
+      summary: Represents a water
+      tags:
+      - waters
+      x-openapi-router-controller: openapi_server.controllers.waters_controller
+components:
+  examples:
+    Water:
+      summary: A water example object
+      value:
+        water_id: 1
+        name: Mississippi
+        osm_id: 1756854
+        osm_type: R
+        link: http://gnuboat.engsas.com/mapservice/v1/waters/1
+    WaterCreation:
+      summary: A water example object for creation of a water
+      value:
+        name: Mississippi
+        osm_id: 1756854
+        osm_type: R
+    waters:
+      summary: A sample list with waters
+      value:
+      - water_id: 1
+        name: Mississippi
+        osm_id: 1756854
+        osm_type: R
+        link: http://gnuboat.engsas.com/mapservice/v1/waters/1
+      - water_id: 2
+        name: Bodensee
+        link: http://gnuboat.engsas.com/mapservice/v1/waters/2
+    HttpError:
+      value:
+        code: 404
+        message: Water with id 999999 not found
+  parameters:
+    orderBy:
+      description: 'Order by field: name'
+      explode: true
+      in: query
+      name: orderBy
+      required: false
+      schema:
+        default: name
+        type: string
+      style: form
+    order:
+      description: Order
+      explode: true
+      in: query
+      name: order
+      required: false
+      schema:
+        $ref: '#/components/schemas/order'
+      style: form
+    offset:
+      description: Skip over a number of elements by specifying an offset value for the query
+      explode: true
+      in: query
+      name: offset
+      required: false
+      schema:
+        default: 0
+        example: 0
+        format: int32
+        type: integer
+      style: form
+    limit:
+      description: Limit the number of elements on the response
+      explode: true
+      in: query
+      name: limit
+      required: false
+      schema:
+        default: 10
+        example: 10
+        format: int32
+        type: integer
+      style: form
+  responses:
+    BadRequest:
+      content:
+        application/json:
+          examples:
+            HttpError:
+              $ref: '#/components/examples/HttpError'
+          schema:
+            $ref: '#/components/schemas/HttpError'
+      description: Bad Request (400)
+    Unauthorized:
+      content:
+        application/json:
+          examples:
+            HttpError:
+              $ref: '#/components/examples/HttpError'
+          schema:
+            $ref: '#/components/schemas/HttpError'
+      description: Unauthorized (401) acces to resource
+    NotFound:
+      content:
+        application/json:
+          examples:
+            HttpError:
+              $ref: '#/components/examples/HttpError'
+          schema:
+            $ref: '#/components/schemas/HttpError'
+      description: Water with given Id not found
+  schemas:
+    username:
+      title: Username
+      type: string
+    item_id:
+      format: int32
+      title: Item ID
+      type: integer
+    item_name:
+      title: Item Name
+      type: string
+    osm_type:
+      maxLength: 1
+      minLength: 1
+      type: string
+    Water:
+      example:
+        osm_id: 6
+        osm_type: osm_type
+        manager: manager
+        name: name
+        water_id: 0
+        osm_class: osm_class
+      properties:
+        water_id:
+          format: int32
+          title: Item ID
+          type: integer
+        name:
+          title: Item Name
+          type: string
+        manager:
+          title: Username
+          type: string
+        osm_id:
+          format: int32
+          title: Item ID
+          type: integer
+        osm_type:
+          maxLength: 1
+          minLength: 1
+          type: string
+        osm_class:
+          maxLength: 1
+          minLength: 1
+          type: string
+      required:
+      - name
+      - water_id
+      title: Water
+      type: object
+    WaterCreation:
+      example:
+        osm_id: 0
+        osm_type: osm_type
+        name: name
+      properties:
+        name:
+          title: Item Name
+          type: string
+        osm_id:
+          format: int32
+          title: Item ID
+          type: integer
+        osm_type:
+          maxLength: 1
+          minLength: 1
+          type: string
+      required:
+      - name
+      title: Water
+      type: object
+    waters:
+      items:
+        $ref: '#/components/schemas/Water'
+      title: waters
+      type: array
+    order:
+      default: asc
+      description: |
+        Sort order:
+          * `asc` - Ascending, from A to Z
+          * `desc` - Descending, from Z to A
+      enum:
+      - desc
+      - asc
+      example: asc
+      title: order
+      type: string
+    HttpError:
+      properties:
+        code:
+          format: int32
+          type: integer
+        message:
+          type: string
+      required:
+      - code
+      - message
+      title: HTTP Error Response Object
+      type: object
+  securitySchemes:
+    basicAuth:
+      scheme: basic
+      type: http
+      x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
+    apiKeyAuth:
+      in: header
+      name: X-API-KEY
+      type: apiKey
+      x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
Index: src/mapservice/src-gen/openapi_server/server_impl
===================================================================
--- src/mapservice/src-gen/openapi_server/server_impl	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/server_impl	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,1 @@
+../../src/server_impl/
Index: src/mapservice/src-gen/openapi_server/static/css/GnuBoat.Colors.css
===================================================================
--- src/mapservice/src-gen/openapi_server/static/css/GnuBoat.Colors.css	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/static/css/GnuBoat.Colors.css	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,34 @@
+/*
+    Copyright (C) 2018 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/>.
+*/
+
+:root {
+	--gnuboat-turquois-dark: #347C7C;
+	--gnuboat-turquois-middle: #93C0C0;
+	--gnuboat-turquois-light: #BCD9D9;
+	--gnuboat-green-dark: #45A545;
+	--gnuboat-green-middle: #ACDFAC;
+	--gnuboat-green-light: #CCECCC;
+	--gnuboat-red: #8C1C00;
+	
+	--gnuboat-primary-dark: var(--gnuboat-turquois-dark);
+	--gnuboat-primary-middle: var(--gnuboat-turquois-middle);
+	--gnuboat-primary-light: var(--gnuboat-turquois-light);
+	--gnuboat-secondary-dark: var(--gnuboat-green-dark);
+	--gnuboat-secondary-middle: var(--gnuboat-green-middle);
+	--gnuboat-secondary-light: var(--gnuboat-green-light);
+	--gnuboat-warning: var(--gnuboat-red);
+}
Index: src/mapservice/src-gen/openapi_server/static/css/GnuBoat.css
===================================================================
--- src/mapservice/src-gen/openapi_server/static/css/GnuBoat.css	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/static/css/GnuBoat.css	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,61 @@
+/*
+    Copyright (C) 2016 - 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/>.
+*/
+
+@import url("GnuBoat.Colors.css");
+
+.l-box {
+	padding: 1em;
+}
+
+.leaflet-top {
+	top: 2.5em;
+}
+
+.map-middle {
+	right: 50%;
+}
+
+#logo {
+	height: auto;
+	width: 6em;
+}
+
+#message .error {
+	font-weight: bold;
+	color: var(--gnuboat-warning);
+}
+
+#message .info {
+	font-weight: bold;
+	color: var(--gnuboat-primary-dark);
+}
+
+.viewportGeometry {
+	width: -webkit-calc(100vw - 3em);
+	width:    -moz-calc(100vw - 3em);
+	width:         calc(100vw - 3em);
+	height: -webkit-calc(100vh - 3em);
+	height:    -moz-calc(100vh - 3em);
+	height:         calc(100vh - 3em);
+}
+
+#mapViewport {
+	border: 1px solid var(--gnuboat-primary-light);
+	margin-top: 1.5em;
+	margin-left: 1.5em;
+	background-color: white;
+}
Index: src/mapservice/src-gen/openapi_server/static/css/side-menu.css
===================================================================
--- src/mapservice/src-gen/openapi_server/static/css/side-menu.css	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/static/css/side-menu.css	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,268 @@
+/*
+    Copyright (C) 2017 - 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/>.
+*/
+
+@import url("GnuBoat.Colors.css");
+
+body {
+    color: #777;
+}
+
+.pure-img-responsive {
+    max-width: 100%;
+    height: auto;
+}
+
+/*
+Add transition to containers so they can push in and out.
+*/
+#layout,
+#menu,
+.menu-link {
+    -webkit-transition: all 0.2s ease-out;
+    -moz-transition: all 0.2s ease-out;
+    -ms-transition: all 0.2s ease-out;
+    -o-transition: all 0.2s ease-out;
+    transition: all 0.2s ease-out;
+}
+
+/*
+This is the parent `<div>` that contains the menu and the content area.
+*/
+#layout {
+    position: relative;
+    left: 0;
+    padding-left: 0;
+}
+    #layout.active #menu {
+        left: 150px;
+        width: 150px;
+    }
+
+    #layout.active .menu-link {
+        left: 150px;
+    }
+/*
+The content `<div>` is where all your content goes.
+*/
+.content {
+    margin: 0 auto;
+    padding: 0 2em;
+    max-width: 800px;
+    margin-bottom: 50px;
+    line-height: 1.6em;
+}
+
+.header {
+     margin: 0;
+     color: #333;
+     text-align: center;
+     padding: 2.5em 2em 0;
+     border-bottom: 1px solid #eee;
+ }
+    .header h1 {
+        margin: 0.2em 0;
+        font-size: 3em;
+        font-weight: 300;
+    }
+     .header h2 {
+        font-weight: 300;
+        color: #ccc;
+        padding: 0;
+        margin-top: 0;
+    }
+
+.content-subhead {
+    margin: 50px 0 20px 0;
+    font-weight: 300;
+    color: #888;
+}
+
+
+
+/*
+The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that
+appears on the left side of the page.
+*/
+
+#menu {
+    margin-left: -150px; /* "#menu" width */
+    width: 150px;
+    position: fixed;
+    top: 0;
+    left: 0;
+    bottom: 0;
+    z-index: 2000; /* so the menu or its navicon stays above all content */
+    background: var(--gnuboat-primary-dark);
+    overflow-y: auto;
+    -webkit-overflow-scrolling: touch;
+}
+    /*
+    All anchors inside the menu should be styled like this.
+    */
+    #menu a {
+        color: #fff;
+        border: none;
+        padding: 0.6em 0 0.6em 0.6em;
+    }
+
+    /*
+    Remove all background/borders, since we are applying them to #menu.
+    */
+     #menu .pure-menu,
+     #menu .pure-menu ul {
+        border: none;
+        background: transparent;
+    }
+
+    /*
+    Add that light border to separate items into groups.
+    */
+    #menu .pure-menu ul,
+    #menu .pure-menu .menu-item-divided {
+        border-top: 1px solid var(--gnuboat-primary-light);
+    }
+        /*
+        Change color of the anchor links on hover/focus.
+        */
+        #menu .pure-menu li a:hover,
+        #menu .pure-menu li a:focus {
+            background: var(--gnuboat-primary-light);
+        }
+
+    /*
+    This styles the selected menu item `<li>`.
+    */
+    #menu .pure-menu-selected,
+    #menu .pure-menu-heading {
+        background: var(--gnuboat-secondary-dark);
+    }
+        /*
+        This styles a link within a selected menu item `<li>`.
+        */
+        #menu .pure-menu-selected a {
+            color: #fff;
+        }
+
+    /*
+    This styles the menu heading.
+    */
+    #menu .pure-menu-heading {
+        font-size: 110%;
+        color: #fff;
+        margin: 0;
+    }
+
+/* -- Dynamic Button For Responsive Menu -------------------------------------*/
+
+/*
+The button to open/close the Menu is custom-made and not part of Pure. Here's
+how it works:
+*/
+
+/*
+`.menu-link` represents the responsive menu toggle that shows/hides on
+small screens.
+*/
+.menu-link {
+    position: fixed;
+    display: block; /* show this only on small screens */
+    top: 0;
+    left: 0; /* "#menu width" */
+    background: #000;
+    background: rgba(0,0,0,0.7);
+    font-size: 10px; /* change this value to increase/decrease button size */
+    z-index: 10;
+    width: 2em;
+    height: auto;
+    padding: 2.1em 1.6em;
+	z-index: 1500;
+}
+
+    .menu-link:hover,
+    .menu-link:focus {
+        background: #000;
+    }
+
+    .menu-link span {
+        position: relative;
+        display: block;
+    }
+
+    .menu-link span,
+    .menu-link span:before,
+    .menu-link span:after {
+        background-color: #fff;
+        width: 100%;
+        height: 0.2em;
+    }
+
+        .menu-link span:before,
+        .menu-link span:after {
+            position: absolute;
+            margin-top: -0.6em;
+            content: " ";
+        }
+
+        .menu-link span:after {
+            margin-top: 0.6em;
+        }
+
+
+/* -- Responsive Styles (Media Queries) ------------------------------------- */
+
+/*
+Hides the menu at `48em`, but modify this based on your app's needs.
+*/
+@media (min-width: 99999em) {
+
+    .header,
+    .content {
+        padding-left: 2em;
+        padding-right: 2em;
+    }
+
+    #layout {
+        padding-left: 150px; /* left col width "#menu" */
+        left: 0;
+    }
+    #menu {
+        left: 150px;
+    }
+
+    .menu-link {
+        position: fixed;
+        left: 150px;
+        display: none;
+    }
+
+    #layout.active .menu-link {
+        left: 150px;
+    }
+}
+
+@media (max-width: 99999em) {
+    /* Only apply this when the window is small. Otherwise, the following
+    case results in extra padding on the left:
+        * Make the window small.
+        * Tap the menu to trigger the active state.
+        * Make the window large again.
+    */
+    #layout.active {
+        position: relative;
+        left: 150px;
+    }
+}
Index: src/mapservice/src-gen/openapi_server/static/index.html
===================================================================
--- src/mapservice/src-gen/openapi_server/static/index.html	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/static/index.html	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,130 @@
+<!--
+    Copyright (C) 2016 - 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/>.
+-->
+<!DOCTYPE HTML>
+<html>
+	<head profile="http://www.w3.org/2005/10/profile">
+		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<link rel="icon" type="image/png" href="resources/gnuboat-256-256-transparent.png"/>
+		<title>GNUBoat Web Application</title>
+		
+		<link rel="stylesheet" href="lib/css/pure/pure-min.css" type="text/css"/>
+		<!--[if lte IE 8]>
+		<link rel="stylesheet" content="text/css" href="lib/css/pure/grids-responsive-old-ie-min.css">
+		<![endif]-->
+		<!--[if gt IE 8]><!-->
+		<link rel="stylesheet" content="text/css" href="lib/css/pure/grids-responsive-min.css">
+		<!--<![endif]-->
+		<link rel="stylesheet" content="text/css" href="lib/css/leaflet/leaflet.css"/>
+		
+		<script src="lib/js/jquery-3.2.1.min.js" type="text/javascript"></script>
+		<script src="lib/js/jquery.validate.min.js" type="text/javascript"></script>
+		<script src="lib/js/leaflet.js" type="text/javascript"></script>
+		<!--<script src="lib/js/leaflet.hotline.min.js" type="text/javascript"></script>-->
+		
+		<link rel="stylesheet" href="css/GnuBoat.css" type="text/css"/>
+		<link rel="stylesheet" href="css/side-menu.css" type="text/css"/>
+		<script language="javascript" src="js/GnuBoat.js" type="text/javascript"></script>
+		<script language="javascript" src="js/GnuBoat.Webserver.js" type="text/javascript"></script>
+		<script language="javascript" type="text/javascript">
+			var active = 'active';
+			var layout = null;
+			var menu = null;
+			var menuLink = null;
+			var content = null;
+
+			function toggleAll() {
+				layout.toggleClass(active);
+				menu.toggleClass(active);
+				menuLink.toggleClass(active);
+			}
+
+			$(document).ready(function () {
+				layout   = $("#layout");
+				menu     = $("#menu");
+				menuLink = $("#menuLink");
+				content  = $("#main");
+
+				menuLink.click(function () {
+					toggleAll();
+				});
+
+				content.click(function() {
+					if (menu.hasClass(active)) {
+						toggleAll();
+					}
+				});
+				
+				GnuBoat.Webserver.initialize();
+				GnuBoat.Webserver.setServer("http://localhost:8080/mapservice/v1/");
+			});
+		</script>
+	</head>
+	<body>
+		<div id="layout" class="">
+			<a id="menuLink" class="menu-link" href="#menu"><!-- Hamburger icon --><span></span></a>
+			<div id="menu" class="">
+				<div class="pure-menu">
+					<a class="pure-menu-heading" href="#">GNUBoat</a>
+					<ul class="pure-menu-list">
+						<li class="pure-menu-item"><a id="linkMap" class="pure-menu-link" href="#map">Map</a></li>
+						<li class="pure-menu-item"><a class="pure-menu-link" href="#upload">Upload</a></li>
+						<li class="pure-menu-item"><a id="linkMyGnuboat" class="pure-menu-link" href="#mygnuboat">My GnuBoat</a></li>
+					</ul>
+				</div>
+			</div>
+			<div id="main">
+				<!--<div class="content">-->
+				<a name="map"></a>
+				<div id="mapViewport" class="viewportGeometry">
+					<div class="leaflet-top map-middle">
+						<div class="leaflet-control">
+							<img id="logo" src="resources/gnuboat-256-256-transparent.png" />
+						</div>
+					</div>
+				</div>
+				<!--</div>-->
+				<div class="content">
+					<a name="mygnuboat"></a>
+					<div id="login">
+						<form id="loginForm" class="pure-form pure-form-aligned">
+							<fieldset>
+								<legend>Login</legend>
+								<div class="pure-control-group">
+									<label for="loginUsername">Username:</label>
+									<input id="loginUsername" type="text" name="loginUsername" value="" required>
+								</div>
+								<div class="pure-control-group">
+									<label for="loginPassword">Password:</label>
+									<input id="loginPassword" type="password" name="loginPassword" value="" required>
+								</div>
+								<input type="submit" class="pure-button pure-button-primary" name="loginButton" value="Login"/>
+							</fieldset>
+						</form>
+					</div>
+					<div id="myWaters">
+						<h2 class="content-subhead">My Waters</h2>
+						<form id="myWatersForm" class="pure-form">
+							<div class="pure-control-group">
+								<select id="myWatersSelect" class="pure-input-1"></select>
+							</div>
+						</form>
+					</div>
+				</div>
+			</div>
+	</body>
+</html>
Index: src/mapservice/src-gen/openapi_server/static/js/GnuBoat.Webserver.js
===================================================================
--- src/mapservice/src-gen/openapi_server/static/js/GnuBoat.Webserver.js	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/static/js/GnuBoat.Webserver.js	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,147 @@
+/*
+
+    Copyright (C) 2018 - 2019 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+
+*/
+
+/** @namespace GnuBoat JavaScript namespace */
+var GnuBoat = GnuBoat || {};
+/** @namespace GnuBoat Webserver JavaScript namespace */
+GnuBoat.Webserver = GnuBoat.Webserver || {};
+
+GnuBoat.Webserver.initialize = function()
+{
+	GnuBoat.Webserver.private.mapSetup();
+	$("#loginForm").validate({
+		rules: {
+			loginUsername: {
+				required: true
+			},
+			loginPassword: {
+				required: true
+			}
+		},
+		submitHandler: function(form){
+			GnuBoat.Webserver.login(form);
+		}
+	});
+	
+	$("#login").hide();
+	$("#myWaters").hide();
+	$("#linkMyGnuboat").click(function(){ $("#mapViewport").hide(); GnuBoat.Webserver.loginCheck(); });
+	$("#linkMap").click(function(){ $("#mapViewport").show(); });
+}
+
+/**
+ * @brief Sets the webservice base url, used by any other functions
+ */
+GnuBoat.Webserver.setServer = function(baseUrl)
+{
+	if(baseUrl.slice(-1) != "/")
+		baseUrl += "/";
+	GnuBoat.Webserver.private.serverBaseUrl = baseUrl;
+}
+
+GnuBoat.Webserver.private = {
+	loggedin: false,
+	map: null,
+	mapSetup: function ()
+	{
+		GnuBoat.Webserver.private.map = L.map('mapViewport').setView([48.43, 10.04], 17);
+		
+		var layer_openstreetmap = L.tileLayer(
+			'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+			{ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="http://www.openseamap.org">OpenSeaMap</a>, <a href="http://gnuboat.engsas.de">GNUBoat</a> contributors'}
+		).addTo(GnuBoat.Webserver.private.map);
+		var layer_openseamap = L.tileLayer(
+			'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
+			{attribute: '&copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'}
+		).addTo(GnuBoat.Webserver.private.map);
+		
+		// add GNUBoat layers
+		var layer_gnuboat_accuracy_low = L.tileLayer(
+			'./tiles/gnuboat_10_100/{z}/{x}/{y}.png',
+			{tms: true, opacity: 0.5, zIndex: 98, attribute: '&copy; <a href="http://gnuboat.engsas.de">GNUBoat</a> contributors'}
+		);
+		var layer_gnuboat_accuracy_high = L.tileLayer(
+			'./tiles/gnuboat_100_100/{z}/{x}/{y}.png',
+			{tms: true, opacity: 0.5, zIndex: 98, attribute: '&copy; <a href="http://gnuboat.engsas.de">GNUBoat</a> contributors'}
+		).addTo(GnuBoat.Webserver.private.map);
+		
+		// add layer control
+		var baselayers = {
+			"Map": layer_openstreetmap,
+		};
+		// overlays
+		var overlays = {"Seamarks": layer_openseamap,
+			"GNUBoat Low Accuracy": layer_gnuboat_accuracy_low,
+			"GNUBoat High Accuracy": layer_gnuboat_accuracy_high,
+		};
+		GnuBoat.Webserver.private.mapControl = L.control.layers(
+			baselayers, overlays,
+			{hideSingleBase: true, sortLayers: true, }
+		).addTo(GnuBoat.Webserver.private.map);
+		
+		// add scale
+		L.control.scale().addTo(GnuBoat.Webserver.private.map);
+	}
+};
+
+GnuBoat.Webserver.login = function(form)
+{
+	Cookies.set('username', $("#loginUsername").val());
+	Cookies.set('password', $("#loginPassword").val());
+	GnuBoat.Webserver.private.loggedin = false;
+	
+	// getting my waters
+	$.ajax({
+		headers: {
+// 			manager: Cookies.get('username')
+			manager: "bla"
+		},
+		dataType: "json",
+		url: GnuBoat.Webserver.private.serverBaseUrl +'waters',
+	}).done(function(data) {
+		GnuBoat.Webserver.private.loggedin = true;
+		GnuBoat.Webserver.loginCheck();
+		
+		$("#myWatersDiv").empty();
+		if(data.length < 1){
+			$("<p>No Waters found!</p>").appendTo("#myWatersDiv");
+		}
+		else{
+			$('<select id="myWatersSelect" class="pure-input-1"></select>').appendTo("#myWatersDiv");
+			data.forEach(function(value, index){
+				$("<option value=\""+ value.water_id +"\">"+ value.name +"</option>").appendTo("#myWatersSelect");
+			})
+		}
+		$("#myWaters").show();
+	}).fail(function() {
+		alert('request failed');
+	});
+};
+
+GnuBoat.Webserver.loginCheck = function()
+{
+	console.log([Cookies.get('username'), Cookies.get('username') == undefined, Cookies.get('password'), Cookies.get('password') == undefined, GnuBoat.Webserver.private.loggedin]);
+	if(Cookies.get('username') == undefined || Cookies.get('password') == undefined || !GnuBoat.Webserver.private.loggedin){
+		$("#login").show();
+		return;
+	}
+	$("#login").hide();
+};
Index: src/mapservice/src-gen/openapi_server/static/js/GnuBoat.js
===================================================================
--- src/mapservice/src-gen/openapi_server/static/js/GnuBoat.js	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/static/js/GnuBoat.js	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,33 @@
+/*
+
+    Copyright (C) 2016 - 2018 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+
+*/
+
+/** @namespace GnuBoat JavaScript namespace */
+var GnuBoat = GnuBoat || {};
+
+/**
+ * @brief Used to display user messages
+ */
+GnuBoat.displayMessage = function(text)
+{
+	$("#message").empty();
+	$(text).appendTo("#message");
+	location.hash = "#messages";
+}
Index: src/mapservice/src-gen/openapi_server/templates/index.html
===================================================================
--- src/mapservice/src-gen/openapi_server/templates/index.html	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/templates/index.html	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,131 @@
+<!--
+    Copyright (C) 2016 - 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/>.
+-->
+<!DOCTYPE HTML>
+<html>
+	<head profile="http://www.w3.org/2005/10/profile">
+		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<link rel="icon" type="image/png" href="{{ url_for('static', filename = 'resources/gnuboat-256-256-transparent.png') }}"/>
+		<title>GNUBoat Web Application</title>
+		
+		<link rel="stylesheet" href="{{ url_for('static', filename = 'lib/css/pure/pure-min.css') }}" type="text/css"/>
+		<!--[if lte IE 8]>
+		<link rel="stylesheet" content="text/css" href="lib/css/pure/grids-responsive-old-ie-min.css">
+		<![endif]-->
+		<!--[if gt IE 8]><!-->
+		<link rel="stylesheet" content="text/css" href="{{ url_for('static', filename = 'lib/css/pure/grids-responsive-min.css') }}">
+		<!--<![endif]-->
+		<link rel="stylesheet" content="text/css" href="{{ url_for('static', filename = 'lib/css/leaflet/leaflet.css') }}"/>
+		
+		<script src="{{ url_for('static', filename = 'lib/js/jquery-3.2.1.min.js') }}" type="text/javascript"></script>
+		<script src="{{ url_for('static', filename = 'lib/js/jquery.validate.min.js') }}" type="text/javascript"></script>
+		<script src="{{ url_for('static', filename = 'lib/js/leaflet.js') }}" type="text/javascript"></script>
+		<script src="{{ url_for('static', filename = 'lib/js/js.cookie.js') }}"></script>
+		<!--<script src="lib/js/leaflet.hotline.min.js" type="text/javascript"></script>-->
+		
+		<link rel="stylesheet" href="{{ url_for('static', filename = 'css/GnuBoat.css') }}" type="text/css"/>
+		<link rel="stylesheet" href="{{ url_for('static', filename = 'css/side-menu.css') }}" type="text/css"/>
+		<script language="javascript" src="{{ url_for('static', filename = 'js/GnuBoat.js') }}" type="text/javascript"></script>
+		<script language="javascript" src="{{ url_for('static', filename = 'js/GnuBoat.Webserver.js') }}" type="text/javascript"></script>
+		<script language="javascript" type="text/javascript">
+			var active = 'active';
+			var layout = null;
+			var menu = null;
+			var menuLink = null;
+			var content = null;
+
+			function toggleAll() {
+				layout.toggleClass(active);
+				menu.toggleClass(active);
+				menuLink.toggleClass(active);
+			}
+
+			$(document).ready(function () {
+				layout   = $("#layout");
+				menu     = $("#menu");
+				menuLink = $("#menuLink");
+				content  = $("#main");
+
+				menuLink.click(function () {
+					toggleAll();
+				});
+
+				content.click(function() {
+					if (menu.hasClass(active)) {
+						toggleAll();
+					}
+				});
+				
+				GnuBoat.Webserver.initialize();
+				GnuBoat.Webserver.setServer("v1/");
+			});
+		</script>
+	</head>
+	<body>
+		<div id="layout" class="">
+			<a id="menuLink" class="menu-link" href="#menu"><!-- Hamburger icon --><span></span></a>
+			<div id="menu" class="">
+				<div class="pure-menu">
+					<a class="pure-menu-heading" href="#">GNUBoat</a>
+					<ul class="pure-menu-list">
+						<li class="pure-menu-item"><a id="linkMap" class="pure-menu-link" href="#map">Map</a></li>
+						<li class="pure-menu-item"><a class="pure-menu-link" href="#upload">Upload</a></li>
+						<li class="pure-menu-item"><a id="linkMyGnuboat" class="pure-menu-link" href="#mygnuboat">My GnuBoat</a></li>
+					</ul>
+				</div>
+			</div>
+			<div id="main">
+				<!--<div class="content">-->
+				<a name="map"></a>
+				<div id="mapViewport" class="viewportGeometry">
+					<div class="leaflet-top map-middle">
+						<div class="leaflet-control">
+							<img id="logo" src="{{ url_for('static', filename = 'resources/gnuboat-256-256-transparent.png') }}" />
+						</div>
+					</div>
+				</div>
+				<!--</div>-->
+				<div class="content">
+					<a name="mygnuboat"></a>
+					<div id="login">
+						<form id="loginForm" class="pure-form pure-form-aligned">
+							<fieldset>
+								<legend>Login</legend>
+								<div class="pure-control-group">
+									<label for="loginUsername">Username:</label>
+									<input id="loginUsername" type="text" name="loginUsername" value="" required>
+								</div>
+								<div class="pure-control-group">
+									<label for="loginPassword">Password:</label>
+									<input id="loginPassword" type="password" name="loginPassword" value="" required>
+								</div>
+								<input type="submit" class="pure-button pure-button-primary" name="loginButton" value="Login"/>
+							</fieldset>
+						</form>
+					</div>
+					<div id="myWaters">
+						<h2 class="content-subhead">My Waters</h2>
+						<form id="myWatersForm" class="pure-form">
+							<div id="myWatersDiv" class="pure-control-group">
+								
+							</div>
+						</form>
+					</div>
+				</div>
+			</div>
+	</body>
+</html>
Index: src/mapservice/src-gen/openapi_server/test/__init__.py
===================================================================
--- src/mapservice/src-gen/openapi_server/test/__init__.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/test/__init__.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,16 @@
+import logging
+
+import connexion
+from flask_testing import TestCase
+
+from openapi_server.encoder import JSONEncoder
+
+
+class BaseTestCase(TestCase):
+
+    def create_app(self):
+        logging.getLogger('connexion.operation').setLevel('ERROR')
+        app = connexion.App(__name__, specification_dir='../openapi/')
+        app.app.json_encoder = JSONEncoder
+        app.add_api('openapi.yaml')
+        return app.app
Index: src/mapservice/src-gen/openapi_server/test/test_default_controller.py
===================================================================
--- src/mapservice/src-gen/openapi_server/test/test_default_controller.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/test/test_default_controller.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,32 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+import unittest
+
+from flask import json
+from six import BytesIO
+
+from openapi_server.models.water import Water  # noqa: E501
+from openapi_server.test import BaseTestCase
+
+
+class TestDefaultController(BaseTestCase):
+    """DefaultController integration test stubs"""
+
+    def test_water_get_by_id(self):
+        """Test case for water_get_by_id
+
+        Represents a water
+        """
+        headers = { 
+        }
+        response = self.client.open(
+            '/mapservice/v1/waters/{id}'.format(id=56),
+            method='GET',
+            headers=headers)
+        self.assert200(response,
+                       'Response body is : ' + response.data.decode('utf-8'))
+
+
+if __name__ == '__main__':
+    unittest.main()
Index: src/mapservice/src-gen/openapi_server/test/test_waters_controller.py
===================================================================
--- src/mapservice/src-gen/openapi_server/test/test_waters_controller.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/test/test_waters_controller.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,34 @@
+# coding: utf-8
+
+from __future__ import absolute_import
+
+from flask import json
+from six import BytesIO
+
+from openapi_server.models.order import Order  # noqa: E501
+from openapi_server.test import BaseTestCase
+
+
+class TestWatersController(BaseTestCase):
+    """WatersController integration test stubs"""
+
+    def test_waters_get(self):
+        """Test case for waters_get
+
+        Waters_GET
+        """
+        query_string = [('order_by', 'order_by_example'),
+                        ('order', Order()),
+                        ('offset', 0),
+                        ('limit', 10)]
+        response = self.client.open(
+            '/mapservice/v1/waters',
+            method='GET',
+            query_string=query_string)
+        self.assert200(response,
+                       'Response body is : ' + response.data.decode('utf-8'))
+
+
+if __name__ == '__main__':
+    import unittest
+    unittest.main()
Index: src/mapservice/src-gen/openapi_server/util.py
===================================================================
--- src/mapservice/src-gen/openapi_server/util.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/openapi_server/util.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,141 @@
+import datetime
+
+import six
+import typing
+
+
+def _deserialize(data, klass):
+    """Deserializes dict, list, str into an object.
+
+    :param data: dict, list or str.
+    :param klass: class literal, or string of class name.
+
+    :return: object.
+    """
+    if data is None:
+        return None
+
+    if klass in six.integer_types or klass in (float, str, bool):
+        return _deserialize_primitive(data, klass)
+    elif klass == object:
+        return _deserialize_object(data)
+    elif klass == datetime.date:
+        return deserialize_date(data)
+    elif klass == datetime.datetime:
+        return deserialize_datetime(data)
+    elif type(klass) == typing.GenericMeta:
+        if klass.__extra__ == list:
+            return _deserialize_list(data, klass.__args__[0])
+        if klass.__extra__ == dict:
+            return _deserialize_dict(data, klass.__args__[1])
+    else:
+        return deserialize_model(data, klass)
+
+
+def _deserialize_primitive(data, klass):
+    """Deserializes to primitive type.
+
+    :param data: data to deserialize.
+    :param klass: class literal.
+
+    :return: int, long, float, str, bool.
+    :rtype: int | long | float | str | bool
+    """
+    try:
+        value = klass(data)
+    except UnicodeEncodeError:
+        value = six.u(data)
+    except TypeError:
+        value = data
+    return value
+
+
+def _deserialize_object(value):
+    """Return an original value.
+
+    :return: object.
+    """
+    return value
+
+
+def deserialize_date(string):
+    """Deserializes string to date.
+
+    :param string: str.
+    :type string: str
+    :return: date.
+    :rtype: date
+    """
+    try:
+        from dateutil.parser import parse
+        return parse(string).date()
+    except ImportError:
+        return string
+
+
+def deserialize_datetime(string):
+    """Deserializes string to datetime.
+
+    The string should be in iso8601 datetime format.
+
+    :param string: str.
+    :type string: str
+    :return: datetime.
+    :rtype: datetime
+    """
+    try:
+        from dateutil.parser import parse
+        return parse(string)
+    except ImportError:
+        return string
+
+
+def deserialize_model(data, klass):
+    """Deserializes list or dict to model.
+
+    :param data: dict, list.
+    :type data: dict | list
+    :param klass: class literal.
+    :return: model object.
+    """
+    instance = klass()
+
+    if not instance.openapi_types:
+        return data
+
+    for attr, attr_type in six.iteritems(instance.openapi_types):
+        if data is not None \
+                and instance.attribute_map[attr] in data \
+                and isinstance(data, (list, dict)):
+            value = data[instance.attribute_map[attr]]
+            setattr(instance, attr, _deserialize(value, attr_type))
+
+    return instance
+
+
+def _deserialize_list(data, boxed_type):
+    """Deserializes a list and its elements.
+
+    :param data: list to deserialize.
+    :type data: list
+    :param boxed_type: class literal.
+
+    :return: deserialized list.
+    :rtype: list
+    """
+    return [_deserialize(sub_data, boxed_type)
+            for sub_data in data]
+
+
+def _deserialize_dict(data, boxed_type):
+    """Deserializes a dict and its elements.
+
+    :param data: dict to deserialize.
+    :type data: dict
+    :param boxed_type: class literal.
+
+    :return: deserialized dict.
+    :rtype: dict
+    """
+    return {k: _deserialize(v, boxed_type)
+            for k, v in six.iteritems(data)}
Index: src/mapservice/src-gen/requirements.txt
===================================================================
--- src/mapservice/src-gen/requirements.txt	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/requirements.txt	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,4 @@
+connexion == 2.0.2
+swagger-ui-bundle == 0.0.2
+python_dateutil == 2.6.0
+setuptools >= 21.0.0
Index: src/mapservice/src-gen/setup.py
===================================================================
--- src/mapservice/src-gen/setup.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/setup.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+import sys
+from setuptools import setup, find_packages
+
+NAME = "openapi_server"
+VERSION = "1.0.0"
+
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+
+REQUIRES = [
+    "connexion==2.0.0",
+    "swagger-ui-bundle==0.0.2",
+    "python_dateutil==2.6.0"
+]
+
+setup(
+    name=NAME,
+    version=VERSION,
+    description="GNUBoat Mapservice API",
+    author_email="info@engsas.de",
+    url="",
+    keywords=["OpenAPI", "GNUBoat Mapservice API"],
+    install_requires=REQUIRES,
+    packages=find_packages(),
+    package_data={'': ['openapi/openapi.yaml']},
+    include_package_data=True,
+    entry_points={
+        'console_scripts': ['openapi_server=openapi_server.__main__:main']},
+    long_description="""\
+    API to upload log files with water depth to GNUBoat server
+    """
+)
+
Index: src/mapservice/src-gen/test-requirements.txt
===================================================================
--- src/mapservice/src-gen/test-requirements.txt	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/test-requirements.txt	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,6 @@
+flask_testing==0.6.1
+coverage>=4.0.3
+nose>=1.3.7
+pluggy>=0.3.1
+py>=1.4.31
+randomize>=0.13
Index: src/mapservice/src-gen/tox.ini
===================================================================
--- src/mapservice/src-gen/tox.ini	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src-gen/tox.ini	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,10 @@
+[tox]
+envlist = py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+     -r{toxinidir}/test-requirements.txt
+
+commands=
+   nosetests \
+      []
Index: src/mapservice/src/server_impl/Config.py
===================================================================
--- src/mapservice/src/server_impl/Config.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/Config.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,34 @@
+'''
+    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/>.
+'''
+class Config(object):
+	DEBUG = False
+	TESTING = False
+	CREATE_TEST_DATABASE = False
+	SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/test.db'
+	SQLALCHEMY_TRACK_MODIFICATIONS = False
+
+class ProductionConfig(Config):
+	SQLALCHEMY_DATABASE_URI = 'mysql://gnuboat:gnuboat@localhost/gnuboat_mapservice'
+
+class DevelopmentConfig(Config):
+	DEBUG = True
+	CREATE_TEST_DATABASE = True
+
+class TestingConfig(Config):
+	TESTING = True
+	DEBUG = True
+	CREATE_TEST_DATABASE = True
Index: src/mapservice/src/server_impl/HttpErrors.py
===================================================================
--- src/mapservice/src/server_impl/HttpErrors.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/HttpErrors.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,20 @@
+'''
+    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/>.
+'''
+
+BadRequest = ('Bad Request', 400)
+Unauthorized = ('Unauthorized', 401)
+NotFound = ('Not Found', 404)
Index: src/mapservice/src/server_impl/controllers/UsersController.py
===================================================================
--- src/mapservice/src/server_impl/controllers/UsersController.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/controllers/UsersController.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,90 @@
+'''
+    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/>.
+'''
+import connexion
+
+import datetime
+import hashlib
+
+from ..database.Model import User, ApiKey
+from ..HttpErrors import BadRequest, Unauthorized, NotFound
+
+def loggedin_username():
+	return connexion.context['user']
+
+def loggedin_user():
+	username = loggedin_username()
+	user = User.query.filter_by(username=username).all()
+	if len(user) != 1:
+		return None
+	return user[0]
+
+def users_activate(activationCode):
+	user = User.query.filter_by(activation_code=activationCode).all()
+	if len(user) != 1:
+		return 'Bad Request', 302, {'Location': 'activation_failed.html'}
+	
+	user = user[0]
+	user.activated = True
+	user.activation_code = ""
+	return 'Success', 302, {'Location': 'activation_succeeded.html'}
+
+def users_api_key_create():
+	user = loggedin_user()
+	if user is None:
+		return Unauthorized
+	
+	api_key = hashlib.md5("{}{}".format(datetime.datetime.now().strftime("%Y%m%d%H%M%S"), user.salt).encode()).hexdigest()
+	user.apikeys.append(ApiKey(user=user, key=api_key))
+		
+	return api_key
+
+def users_api_key_delete(api_key):
+	user = loggedin_user()
+	if user is None:
+		return Unauthorized
+	
+	if not ApiKey.query.filter_by(user=user, key=api_key).delete():
+		return BadRequest
+	
+	result = []
+	for apiKey in user.apikeys:
+		result.append(apiKey.key)
+	return result
+
+def users_get():
+	user = loggedin_user()
+	if user is None:
+		return Unauthorized
+	
+	# create user dict and remove not needed entries
+	result = user.to_dict()
+	del result['password']
+	del result['salt']
+	del result['activationCode']
+	
+	# add api keys of the user to the result dict
+
+	result['apiKeys'] = []
+	for apiKey in user.apikeys:
+		result['apiKeys'].append(apiKey.key)
+	
+	return result
+
+def users_register(user_creation):
+	print(user_creation)
+	
+	return 'Not Found', 500
Index: src/mapservice/src/server_impl/controllers/WatersController.py
===================================================================
--- src/mapservice/src/server_impl/controllers/WatersController.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/controllers/WatersController.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,53 @@
+'''
+    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/>.
+'''
+import connexion
+
+from ..database.Model import User, Water
+
+def waters_get(name=None, manager=None, order_by=None, offset=None, limit=None):
+	query = None
+	if manager is not None:
+		manager = User.query.filter_by(username=manager).all()
+		if len(manager) != 1:
+			return NoContent, 404
+
+	query = None
+	if manager is not None:
+		if len(manager) == 1 and name is not None:
+			query = Water.query.filter_by(name = name, manager = manager[0])
+		elif len(manager) == 1:
+			query = Water.query.filter_by(manager = manager[0])
+	elif name is not None:
+		query = Water.query.filter_by(name = name)
+	
+	if query is None:
+		query = Water.query.filter_by(name = '*')
+	
+	result = []
+	for water in query:
+		result.append(water.to_dict())
+	return result
+
+def water_get_by_id(id):
+	return {
+		'water_id': id,
+		'name': 'Mississippi'
+	}
+
+def waters_post(water):
+	print(connexion.context['user'])
+	return water
Index: src/mapservice/src/server_impl/database/Model.py
===================================================================
--- src/mapservice/src/server_impl/database/Model.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/database/Model.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,138 @@
+'''
+    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/>.
+'''
+import flask
+from flask_sqlalchemy import SQLAlchemy
+from sqlalchemy import inspect, text
+import hashlib
+import datetime
+
+db = SQLAlchemy()
+
+class User(db.Model):
+	__tablename__ = "users"
+	
+	id = db.Column(db.Integer, primary_key=True, autoincrement=True)
+	username = db.Column(db.String(255), nullable=False, unique=True)
+	password = db.Column(db.String(50), nullable=False)
+	salt = db.Column(db.String(50), nullable=False)
+	email = db.Column(db.String(255), nullable=False)
+	first_name = db.Column(db.String(255))
+	last_name = db.Column(db.String(255))
+	activated = db.Column(db.Boolean(), default=False)
+	activation_code = db.Column(db.String(255), default='1234')
+	#activation_code = db.Column(db.String(255), server_default=text('LEFT(MD5(NOW()), 50)'))
+	
+	def to_dict(user):
+		result = {
+			'username': user.username,
+			'password': user.password,
+			'salt': user.salt,
+			'email': user.email,
+			'firstName': "",
+			'lastName': "",
+			'activated': user.activated,
+			
+		}
+		if user.first_name is not None:
+			result['firstName'] = user.first_name
+		if user.last_name is not None:
+			result['lastName'] = user.last_name,
+		if user.activation_code is not None:
+			result['activationCode'] = user.activation_code
+		
+		return result
+	
+	def password_set(self, password):
+		self.salt = hashlib.md5('{}{}'.format(self.username, datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')).encode()).hexdigest()
+		self.password = hashlib.md5('{}{}'.format(password, self.salt).encode()).hexdigest()
+	
+	def password_verify(self, password):
+		return hashlib.md5("{}{}".format(password, self.salt).encode()).hexdigest() == self.password
+	
+
+class ApiKey(db.Model):
+	__tablename__ = "apikeys"
+
+	id = db.Column(db.Integer, primary_key=True, autoincrement=True)
+	user_id = db.Column(db.BigInteger, db.ForeignKey('users.id'))
+	key = db.Column(db.String(255), nullable=False)
+	user = db.relationship("User", backref=db.backref("apikeys"), lazy=True)
+	
+class Water(db.Model):
+	__tablename__ = "waters"
+	
+	id = db.Column(db.Integer, primary_key=True, autoincrement=True)
+	name = db.Column(db.String(255), nullable=False)
+	manager_id = db.Column(db.Integer, db.ForeignKey('users.id'))
+	osm_id = db.Column(db.BigInteger)
+	osm_type = db.Column(db.String(255))
+	osm_class = db.Column(db.String(255))
+	manager = db.relationship("User", backref=db.backref("waters", uselist=False), lazy=True)
+	
+	def to_dict(obj):
+		result = { 'water_id': obj.id, 'name': obj.name }
+		if obj.manager:
+			result['manager'] = obj.manager.username
+		if obj.osm_id:
+			result['osm_id'] = obj.osm_id
+		if obj.osm_type:
+			result['osm_type'] = obj.osm_type
+		if obj.osm_class:
+			result['osm_class'] = obj.osm_class
+		return result
+
+#class Gauge(db.Model):
+	#__tablename__ = "gauges"
+	
+	#id = db.Column(db.Integer, primary_key=True, autoincrement=True)
+	#name = db.Column(db.String(255), nullable=False)
+	#manager_id = db.Column(db.Integer, db.ForeignKey('users.id'))
+	#location = POINT
+	#water_id = db.Column(db.Integer, db.ForeignKey('waters.id'))
+	#comment = db.Column(db.String(255))
+	#osm_id = db.Column(db.Integer)
+	#osm_type = db.Column(db.String(255))
+	#osm_class = db.Column(db.String(255))
+	#manager = db.relationship("User", backref=db.backref("users", order_by=username), lazy=True)
+	#waters = db.relationship("Water", backref=db.backref("waters", order_by=label), lazy=True)
+
+def db_test_setup():
+	db.create_all()
+	
+	if flask.current_app.config['CREATE_TEST_DATABASE'] == True:
+		print("CREATING DATABASE TEST CONTENT")
+		with db.session.no_autoflush:
+			if len(User.query.filter_by(username='john').all()) < 1:
+				test_user_john = User(username='john', email='john@example.org', activated=False, activation_code='dac9630aec642a428cd73f4be0a03569')
+				test_user_john.password_set('testpass2')
+				db.session.add(test_user_john)
+			
+			test_user_jane = User(username='jane', email='jane@example.org', activated=True)
+			test_user_jane.password_set('testpass')
+			test_key_del = ApiKey(user=test_user_jane, key='DelApiKey4711')
+			db.session.add(test_key_del)
+			if len(ApiKey.query.filter_by(key='test_key').all()) < 1:
+				test_key = ApiKey(user=test_user_jane, key='test_key')
+				db.session.add(test_key)
+			if len(ApiKey.query.filter_by(key='ApiKey4712').all()) < 1:
+				test_key = ApiKey(user=test_user_jane, key='ApiKey4712')
+				db.session.add(test_key)
+			if len(Water.query.filter_by(name='Mississippi').all()) < 1:
+				mississippi = Water(name='Mississippi', manager=test_user_jane)
+				db.session.add(mississippi)
+			db.session.commit()
+
Index: src/mapservice/src/server_impl/security/Security.py
===================================================================
--- src/mapservice/src/server_impl/security/Security.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/security/Security.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,21 @@
+from ..database.Model import ApiKey, User
+
+def auth_basic(username, password, required_scopes=None):
+	user = User.query.filter_by(username=username).all()
+	if len(user) != 1:
+		return None
+	if user[0].password_verify(password):
+		return {'sub': user[0].username}
+	return None
+
+def auth_api(apikey, required_scopes=None):
+	keys = ApiKey.query.filter_by(key=apikey).all()
+	if len(keys) != 1:
+		return None
+	
+	key_db = keys[0]
+	if apikey == key_db.key:
+		return {'sub': key_db.user.username }
+
+	# optional: raise exception for custom error response
+	return None
Index: src/mapservice/src/server_impl/tests/test_users.py
===================================================================
--- src/mapservice/src/server_impl/tests/test_users.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
+++ src/mapservice/src/server_impl/tests/test_users.py	(revision 5e4cb7308a6b389143e06dfa849e638ac3c2e3cb)
@@ -0,0 +1,61 @@
+'''
+    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/>.
+'''
+
+import unittest
+import json
+
+from openapi_server.test import BaseTestCase
+
+class TestDefaultController(BaseTestCase):
+	def test_users_get(self):
+		headers = {}
+		response = self.client.open(
+			'/mapservice/v1/user',
+			method='GET',
+			headers=headers)
+		assert response.status_code == 401
+		
+		response = self.client.open(
+			'/mapservice/v1/user',
+			method='GET',
+			headers={'X-API-KEY': 'test_key'})
+		assert response.status_code == 200
+		data = json.loads(response.data)
+		self.check_key("user_id", 2, data)
+		self.check_key("username", "jane", data)
+		self.check_key("first_name", "", data)
+		self.check_key("last_name", "", data)
+		self.check_key("email", "jane@example.org", data)
+		self.check_key("activated", True, data)
+		
+		assert "api_keys" in data
+		assert data["api_keys"][0] == "test_key"
+		assert data["api_keys"][1] == "ApiKey4712"
+		
+		assert "password" not in data
+		assert "salt" not in data
+		assert "activation_code" not in data
+
+	#def users_register(user_creation):
+		#return NoContent, 404
+		
+	def check_key(self, key, value, data):
+		assert key in data
+		assert data[key] == value
+
+if __name__ == '__main__':
+    unittest.main()
