refactor code with hooks
restructured hooks, better auto node instances and fixed query building
fixed findById queries and other issues