refactor server with director routes