refactored all code, to use new db rest api, removed

unnesacary functions and so on.
Merge branch 'lukasdev' into Dev