Updated server/main relations and made it more oop.