Some refactoring and a workaround for parameters in transactional cypher queries

Use cypher to get the labels instead of the rest api (make it work in transactions)