public ReportServer() {
		try {
			server = new Server();
			Network.register(server.getKryo());
			server.start();
			server.bind(Network.PORT, Network.PORT);
			database = new ReportDB();
			
			server.addListener(new Listener() { 
				@Override
				public void received(Connection con, Object o) {
					if(o instanceof LoginRequest) {
						LoginRequest req = (LoginRequest) o;
						LoginResponse res = new LoginResponse();
						if(database.validateUser(req.getUsername(), req.getPassword())) {
							res.setAccepted(true);
						} 
						con.sendTCP(res);
					} else if (o instanceof ReportRequest) {
						ReportRequest req = (ReportRequest) o;
						Report r = database.buildReport(req.getReportid());
						ReportResponse res = new ReportResponse();
						res.setReport(r);
						con.sendTCP(res);
					}
				}
			
			});
		} catch (IOException e) {
			JOptionPane.showMessageDialog(null, "Network error, try restarting the application.");
			e.printStackTrace();
		}
	}