Fix unused machine check, fix insertion of new machines
Fix errorhandling, insert individual machines instead of slices
Use map for counting
Fix db insert and update, halt and reset machine instead of destroy
Normalize pathes before usage