Matched interfaces with those on the server where necessary.
Fixed reference to interfaces and added partial logic for tree building.