public JSONObject processPacket(JSONObject message) {
		PacketTypes type = PacketIdentifier.identifyPacket(message);
		JSONObject response = new JSONObject();
		try {
			switch(type) {
			case REGISTER_DEVICE:
				System.out.println("Registering Device");
				Device device = new Device(message);
				TilistyModel.getInstance().registerDevice(device);
				break;
			case REGISTER_VIEWS:
				//do we have multiple views or just one?
				if(message.has("views")) {
					try {
						JSONArray arr = message.getJSONArray("views");
						for(int i = 0; i < arr.length(); i++) {
							TiViewModel view = new TiViewModel(arr.getJSONObject(i));
							TilistyModel.getInstance().addView(view);
						}
					} catch (JSONException e) {
						e.printStackTrace();
					} 
					
				} else if(message.has("view")) {
					TiViewModel view = new TiViewModel(message.getJSONObject("view"));
					TilistyModel.getInstance().addView(view);
				}
				break;
				case UNKNOWN:
					break;
				default:
					break;
			}
			
			if(message.has("msgId")) {
				response.put("msgId", message.getInt("msgId"));
				response.put("type", "rsp");
			}
			
		} catch(JSONException e) {
			e.printStackTrace();
		}
		
		return response;
		
	}