if (!simulatorExists(port)) {
logger.error("there is no simulator on port " + port);
Response.status(0).build();
}
SimulatorEntity simulator = simulators.get(port);
String path = uriInfo.getPath();
path = removeFirstAndLastSlashesFromUrl(path);
SimulatorRequest simulatorRequest = new SimulatorRequest(method, path, uriInfo.getQueryParameters(),
headers.getRequestHeaders(), body);
simulator.addRequestToQueue(simulatorRequest);
return simulator.generateResponse(simulatorRequest);
}