rewrite of the hiflow backend, not useable version for webservices