added tests for various cases

fixes https://github.com/OpenSourceFieldlinguistics/FieldDB/issues/1506

to runtests
$ node service &
$ ./tests/service-test.sh