added error handeling to node server