private void handleHttpRequests(ChannelHandlerContext ctx, HttpRequest req) {
		
		if (req.getMethod() != HttpMethod.GET){
			log.info("Detected POST request - FORBIDDEN");
			sendHttpResponse(ctx, req, new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.FORBIDDEN));
		}
		switch (req.getUri()){
		case "/":
		{
			log.info("New connection recieved - requesting index.html");
			HttpResponse res = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
			ChannelBuffer content = ServeFile.getContent("index.html");
			res.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/html; charset=UTF-8");
			HttpHeaders.setContentLength(res,content.readableBytes());
			res.setContent(content);
			sendHttpResponse(ctx, req, res);
			log.info("index.html sent");
			return;
		}
			
		case "/favicon.ico":
		{
			sendHttpResponse(ctx, req, new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND));
			return;
		}
			
		case "/status":
		{
			HttpResponse res = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
			ChannelBuffer content = Status.getInstance().printStatus();
			res.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text; charset=UTF-8");
			HttpHeaders.setContentLength(res, content.readableBytes());
			res.setContent(content);
			sendHttpResponse(ctx, req, res);
			return;
		}
			
		}
		
		if (req.getUri().contains(".css")){ 
			String filename = req.getUri().replace("/", "");
			String type = "text/css; charset=UTF-8";
			loadAndSendFile(filename, type, ctx, req);
			return;
		}
		if (req.getUri().contains(".html")){ 
			String filename = req.getUri().replace("/", "");
			String type = "text/html; charset=UTF-8";
			loadAndSendFile(filename, type, ctx, req);
			return;
		}
		if (req.getUri().contains(".js")){ 
			String filename = req.getUri().replace("/", "");
			String type = "text/javascript; charset=UTF-8";
			loadAndSendFile(filename, type, ctx, req);
			return;
		}
		
		
		log.info("Handshake initiated");
		WebSocketServerHandshakerFactory handshakerFactory = new WebSocketServerHandshakerFactory("ws://" + req.getHeader(HttpHeaders.Names.HOST) +"/bableHub", null, false);
		handshaker = handshakerFactory.newHandshaker(req);
		if (handshaker == null){
			log.info("Handshake failed due to unsupported WebSocket version");
			handshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());
		} else {
			
			handshaker.handshake(ctx.getChannel(), req).addListener(WebSocketServerHandshaker.HANDSHAKE_LISTENER);
			log.info("Handshake succeeded, adding channel to subscriber");
			Gson gson = new Gson();
			log.debug("Sending buffered chat:" + gson.toJson(buffer.getBuffer()));
			ctx.getChannel().write(new TextWebSocketFrame(PrepareMessage.createMessage(buffer)));
			log.info("Adding channel: " + ctx.getChannel().getId());
			subscriber.addChannel(ctx.getChannel());
			
		}
	}