diff --git a/api/sample.yaml b/api/sample.yaml
index 30500b4..c699809 100644
--- a/api/sample.yaml
+++ b/api/sample.yaml
@@ -2,7 +2,7 @@
   get:
     summary: all samples in overview
     description: 'Auth: all, levels: read, write, maintain, dev, admin'
-    x-doc: returns only samples with status 10  # TODO: methods /samples/new|deleted
+    x-doc: returns only samples with status 10
     tags:
       - /sample
     responses:
@@ -18,6 +18,30 @@
         $ref: 'api.yaml#/components/responses/401'
       500:
         $ref: 'api.yaml#/components/responses/500'
+
+/samples{group}:
+  parameters:
+    - $ref: 'api.yaml#/components/parameters/Group'
+  get:
+    summary: all new/deleted samples in overview
+    description: 'Auth: basic, levels: maintain, admin'
+    x-doc: returns only samples with status 0/-1
+    tags:
+      - /sample
+    responses:
+      200:
+        description: samples overview
+        content:
+          application/json:
+            schema:
+              type: array
+              items:
+                $ref: 'api.yaml#/components/schemas/SampleRefs'
+      401:
+        $ref: 'api.yaml#/components/responses/401'
+      500:
+        $ref: 'api.yaml#/components/responses/500'
+
 /sample/{id}:
   parameters:
     - $ref: 'api.yaml#/components/parameters/Id'
@@ -130,7 +154,7 @@
   get:
     summary: list all existing field names for custom notes fields
     description: 'Auth: all, levels: read, write, maintain, dev, admin'
-    x-doc: integrity has to be ensured  # TODO: implement mechanism to regularly check note_fields
+    x-doc: integrity has to be ensured
     tags:
       - /sample
     responses:
diff --git a/src/api.ts b/src/api.ts
index 228f166..625e738 100644
--- a/src/api.ts
+++ b/src/api.ts
@@ -20,7 +20,7 @@ export default class api {
       apiDoc = doc;
       apiDoc.paths = apiDoc.paths.allOf.reduce((s, e) => Object.assign(s, e));  // bundle routes
       apiDoc = this.resolveXDoc(apiDoc);
-      oasParser.validate(apiDoc, (err, api) => {
+      oasParser.validate(apiDoc, (err, api) => {  // validate oas schema
         if (err) {
           console.error(err);
         }
@@ -35,8 +35,8 @@ export default class api {
 
   private static resolveXDoc (doc) {  // resolve x-doc properties recursively
     Object.keys(doc).forEach(key => {
-      if (doc[key] !== null && doc[key].hasOwnProperty('x-doc')) {
-        doc[key].description += this.addHtml(doc[key]['x-doc']);
+      if (doc[key] !== null && doc[key].hasOwnProperty('x-doc')) {  // add x-doc to description, is styled via css
+        doc[key].description += 'docs
' + doc[key]['x-doc'] + 'docs
' + text + '
 You requested to reset your password.
Your new password is:
' + newPass + '
If you did not request a password reset, talk to the sysadmin quickly!
Have a nice day.
The DFOP team', err => {
             if (err) return next(err);
             res.json({status: 'OK'});
@@ -166,4 +138,27 @@ router.post('/user/passreset', (req, res, next) => {
 });
 
 
-module.exports = router;
\ No newline at end of file
+module.exports = router;
+
+function getUsername (req, res) {  // returns username or false if action is not allowed
+  req.params.username = req.params[0];  // because of path regex
+  if (req.params.username !== undefined) {  // different username than request user
+    if (!req.auth(res, ['admin'], 'basic')) return false;
+    return req.params.username;
+  }
+  else {
+    return req.authDetails.username;
+  }
+}
+
+async function usernameCheck (name, res, next) {  // check if username is already taken
+  const userData = await UserModel.findOne({name: name}).lean().exec().catch(err => next(err)) as any;
+  if (userData instanceof Error) return false;
+  console.log(userData);
+  console.log(UserValidate.isSpecialName(name));
+  if (userData || UserValidate.isSpecialName(name)) {
+    res.status(400).json({status: 'Username already taken'});
+    return false;
+  }
+  return true;
+}
\ No newline at end of file
diff --git a/src/routes/validate/condition.ts b/src/routes/validate/condition.ts
index 491c318..d752ff3 100644
--- a/src/routes/validate/condition.ts
+++ b/src/routes/validate/condition.ts
@@ -18,7 +18,7 @@ export default class ConditionValidate {
       )
   }
 
-  static input (data, param) {
+  static input (data, param) {  // validate input, set param to 'new' to make all attributes required
     if (param === 'new') {
       return Joi.object({
         sample_id: IdValidate.get().required(),
@@ -36,7 +36,7 @@ export default class ConditionValidate {
     }
   }
 
-  static output (data) {
+  static output (data) {  // validate output and strip unwanted properties, returns null if not valid
     data = IdValidate.stringify(data);
     const {value, error} = Joi.object({
       _id: IdValidate.get(),
diff --git a/src/routes/validate/id.ts b/src/routes/validate/id.ts
index a9bb70a..6b7b677 100644
--- a/src/routes/validate/id.ts
+++ b/src/routes/validate/id.ts
@@ -3,11 +3,11 @@ import Joi from '@hapi/joi';
 export default class IdValidate {
   private static id = Joi.string().pattern(new RegExp('[0-9a-f]{24}')).length(24);
 
-  static get () {
+  static get () {  // return joi validation
     return this.id;
   }
 
-  static valid (id) {
+  static valid (id) {  // validate id
     return this.id.validate(id).error === undefined;
   }
 
@@ -15,11 +15,14 @@ export default class IdValidate {
     return ':id([0-9a-f]{24})';
   }
 
-  static stringify (data) {
+  static stringify (data) {  // convert all ObjectID objects to plain strings
     Object.keys(data).forEach(key => {
-      if (data[key] !== null && data[key].hasOwnProperty('_bsontype') && data[key]._bsontype === 'ObjectID') {
+      if (data[key] !== null && data[key].hasOwnProperty('_bsontype') && data[key]._bsontype === 'ObjectID') {  // stringify id
         data[key] = data[key].toString();
       }
+      else if (typeof data[key] === 'object' && data[key] !== null) {  // deeper into recursion
+        data[key] = this.stringify(data[key]);
+      }
     });
     return data;
   }
diff --git a/src/routes/validate/material.ts b/src/routes/validate/material.ts
index b09c494..c92f440 100644
--- a/src/routes/validate/material.ts
+++ b/src/routes/validate/material.ts
@@ -40,7 +40,7 @@ export default class MaterialValidate {  // validate input for material
       }))
   };
 
-  static input (data, param) {  // validate data, param: new(everything required)/change(available attributes are validated)
+  static input (data, param) {  // validate input, set param to 'new' to make all attributes required
     if (param === 'new') {
       return joi.object({
         name: this.material.name.required(),
@@ -68,7 +68,7 @@ export default class MaterialValidate {  // validate input for material
     }
   }
 
-  static output (data) {  // validate output from database for needed properties, strip everything else
+  static output (data) {  // validate output and strip unwanted properties, returns null if not valid
     data = IdValidate.stringify(data);
     const {value, error} = joi.object({
       _id: IdValidate.get(),
diff --git a/src/routes/validate/measurement.ts b/src/routes/validate/measurement.ts
index 0efaaea..21b38a2 100644
--- a/src/routes/validate/measurement.ts
+++ b/src/routes/validate/measurement.ts
@@ -15,7 +15,7 @@ export default class MeasurementValidate {
       )
   };
 
-  static input (data, param) {
+  static input (data, param) {  // validate input, set param to 'new' to make all attributes required
     if (param === 'new') {
       return Joi.object({
         condition_id: IdValidate.get().required(),
@@ -33,7 +33,7 @@ export default class MeasurementValidate {
     }
   }
 
-  static output (data) {
+  static output (data) {  // validate output and strip unwanted properties, returns null if not valid
     data = IdValidate.stringify(data);
     const {value, error} = Joi.object({
       _id: IdValidate.get(),
diff --git a/src/routes/validate/note_field.ts b/src/routes/validate/note_field.ts
index 7d34d98..68856c9 100644
--- a/src/routes/validate/note_field.ts
+++ b/src/routes/validate/note_field.ts
@@ -8,7 +8,7 @@ export default class NoteFieldValidate {
     qty: Joi.number()
   };
 
-  static output (data) {
+  static output (data) {  // validate output and strip unwanted properties, returns null if not valid
     const {value, error} = Joi.object({
       name: this.note_field.name,
       qty: this.note_field.qty
diff --git a/src/routes/validate/parameters.ts b/src/routes/validate/parameters.ts
index d855815..79e62ef 100644
--- a/src/routes/validate/parameters.ts
+++ b/src/routes/validate/parameters.ts
@@ -4,7 +4,7 @@ export default class ParametersValidate {
   static input (data, parameters, param) {  // data to validate, parameters from template, param: 'new', 'change'
     let joiObject = {};
     parameters.forEach(parameter => {
-      if (parameter.range.hasOwnProperty('values')) {
+      if (parameter.range.hasOwnProperty('values')) {  // append right validation method according to parameter
         joiObject[parameter.name] = Joi.alternatives()
           .try(Joi.string().max(128), Joi.number(), Joi.boolean())
           .valid(...parameter.range.values);
diff --git a/src/routes/validate/res400.ts b/src/routes/validate/res400.ts
index 5e032f7..e4595c8 100644
--- a/src/routes/validate/res400.ts
+++ b/src/routes/validate/res400.ts
@@ -1,3 +1,5 @@
+// respond with 400 and include error details from the joi validation
+
 export default function res400 (error, res) {
   res.status(400).json({status: 'Invalid body format', details: error.details[0].message});
 }
\ No newline at end of file
diff --git a/src/routes/validate/sample.ts b/src/routes/validate/sample.ts
index 9373152..1b23cb1 100644
--- a/src/routes/validate/sample.ts
+++ b/src/routes/validate/sample.ts
@@ -41,7 +41,7 @@ export default class SampleValidate {
     })
   };
 
-  static input (data, param) {  // validate data, param: new(everything required)/change(available attributes are validated)
+  static input (data, param) {  // validate input, set param to 'new' to make all attributes required
     if (param === 'new') {
       return Joi.object({
         color: this.sample.color.required(),
@@ -65,7 +65,7 @@ export default class SampleValidate {
     }
   }
 
-  static output (data) {
+  static output (data) {  // validate output and strip unwanted properties, returns null if not valid
     data = IdValidate.stringify(data);
     const {value, error} = Joi.object({
       _id: IdValidate.get(),
diff --git a/src/routes/validate/template.ts b/src/routes/validate/template.ts
index 269e1a2..571f48c 100644
--- a/src/routes/validate/template.ts
+++ b/src/routes/validate/template.ts
@@ -43,7 +43,7 @@ export default class TemplateValidate {
       )
   };
 
-  static input (data, param, template) {  // validate data, param: new(everything required)/change(available attributes are validated)
+  static input (data, param, template) {  // validate input, set param to 'new' to make all attributes required
     if (param === 'new') {
       if (template === 'treatment') {
         return Joi.object({
@@ -79,10 +79,10 @@ export default class TemplateValidate {
     }
   }
 
-  static output (data, template) {  // validate output from database for needed properties, strip everything else
+  static output (data, template) {  // validate output and strip unwanted properties, returns null if not valid
     data = IdValidate.stringify(data);
     let joiObject;
-    if (template === 'treatment') {
+    if (template === 'treatment') {  // differentiate between measurement and treatment (has number_prefix) template
       joiObject = {
         _id: IdValidate.get(),
         name: this.template.name,
diff --git a/src/routes/validate/user.ts b/src/routes/validate/user.ts
index c146d7e..0c073d0 100644
--- a/src/routes/validate/user.ts
+++ b/src/routes/validate/user.ts
@@ -33,7 +33,7 @@ export default class UserValidate {  // validate input for user
 
   private static specialUsernames = ['admin', 'user', 'key', 'new', 'passreset'];  // names a user cannot take
 
-  static input (data, param) {
+  static input (data, param) {  // validate input, set param to 'new' to make all attributes required
     if (param === 'new') {
       return Joi.object({
         name: this.user.name.required(),
@@ -68,7 +68,7 @@ export default class UserValidate {  // validate input for user
     }
   }
 
-  static output (data) {  // validate output from database for needed properties, strip everything else
+  static output (data) {  // validate output and strip unwanted properties, returns null if not valid
     data = IdValidate.stringify(data);
     const {value, error} = Joi.object({
       _id: IdValidate.get(),
diff --git a/src/test/helper.ts b/src/test/helper.ts
index b7ff49f..3983959 100644
--- a/src/test/helper.ts
+++ b/src/test/helper.ts
@@ -4,13 +4,13 @@ import db from "../db";
 
 
 export default class TestHelper {
-  public static auth = {
+  public static auth = {  // test user credentials
     admin: {pass: 'Abc123!#', key: '000000000000000000001003'},
     janedoe: {pass: 'Xyz890*)', key: '000000000000000000001002'},
     user: {pass: 'Xyz890*)', key: '000000000000000000001001'},
     johnnydoe: {pass: 'Xyz890*)', key: '000000000000000000001004'}
   }
-  public static res = {
+  public static res = {  // default responses
     400: {status: 'Bad request'},
     401: {status: 'Unauthorized'},
     403: {status: 'Forbidden'},
@@ -40,10 +40,10 @@ export default class TestHelper {
 
   static request (server, done, options) {  // options in form: {method, url, auth: {key/basic: 'name' or 'key'/{name, pass}}, httpStatus, req, res}
     let st = supertest(server);
-    if (options.hasOwnProperty('auth') && options.auth.hasOwnProperty('key')) {
+    if (options.hasOwnProperty('auth') && options.auth.hasOwnProperty('key')) {  // resolve API key
       options.url += '?key=' + (this.auth.hasOwnProperty(options.auth.key)? this.auth[options.auth.key].key : options.auth.key);
     }
-    switch (options.method) {
+    switch (options.method) {  // http method
       case 'get':
         st = st.get(options.url)
         break;
@@ -57,10 +57,10 @@ export default class TestHelper {
         st = st.delete(options.url)
         break;
     }
-    if (options.hasOwnProperty('req')) {
+    if (options.hasOwnProperty('req')) {  // request body
       st = st.send(options.req);
     }
-    if (options.hasOwnProperty('auth') && options.auth.hasOwnProperty('basic')) {
+    if (options.hasOwnProperty('auth') && options.auth.hasOwnProperty('basic')) {  // resolve basic auth
       if (this.auth.hasOwnProperty(options.auth.basic)) {
         st = st.auth(options.auth.basic, this.auth[options.auth.basic].pass)
       }
@@ -70,21 +70,21 @@ export default class TestHelper {
     }
     st = st.expect('Content-type', /json/)
       .expect(options.httpStatus);
-    if (options.hasOwnProperty('res')) {
+    if (options.hasOwnProperty('res')) {  // evaluate result
       return st.end((err, res) => {
         if (err) return done (err);
         should(res.body).be.eql(options.res);
         done();
       });
     }
-    else if (this.res.hasOwnProperty(options.httpStatus) && options.default !== false) {
+    else if (this.res.hasOwnProperty(options.httpStatus) && options.default !== false) {  // evaluate default results
       return st.end((err, res) => {
         if (err) return done (err);
         should(res.body).be.eql(this.res[options.httpStatus]);
         done();
       });
     }
-    else {
+    else {  // return object to do .end() manually
       return st;
     }
   }
diff --git a/src/test/loadDev.ts b/src/test/loadDev.ts
index 690044d..15a6868 100644
--- a/src/test/loadDev.ts
+++ b/src/test/loadDev.ts
@@ -1,5 +1,7 @@
 import db from '../db';
 
+// script to load test db into dev db for a clean start
+
 db.connect('dev', () => {
   console.info('dropping data...');
   db.drop(() => {  // reset database