private void putRequest(HttpExchange he) throws IOException {

        try {
            InputStreamReader isr = new InputStreamReader(he.getRequestBody(), "UTF-8");
            BufferedReader br = new BufferedReader(isr);
            String jsonInput = br.readLine();

            String path = he.getRequestURI().getPath();
            int lastIndex = path.lastIndexOf("/");

            if (lastIndex > 0) {
                int id = Integer.parseInt(path.substring(lastIndex + 1));
                Person editedPerson = facade.editPerson(jsonInput, id);
                response = trans.toJson(editedPerson);
                status = 200;
            } else {
                status = 400;
                response = "no id";
            }
        } catch (NumberFormatException nfe) {
            response = "id is not a number";
            status = 404;
        }
    }