private void modifyThread(Map<String, Object> jsonrpc2Params) throws Exception {

        Map<String, Object> params = getParams(jsonrpc2Params,
                new NullableExtendedParam(Constants.Param.Name.THREAD_ID, false),
                new NullableExtendedParam(Constants.Param.Name.HEADLINE, false),
                new NullableExtendedParam(Constants.Param.Name.TEXT, false));

        models.Thread thread = em.find(models.Thread.class, params.get(Constants.Param.Name.THREAD_ID));
        String headline = (String) params.get(Constants.Param.Name.HEADLINE);
        String text = (String) params.get(Constants.Param.Name.TEXT);

        if(thread.getAccount().getId() != accountId){
            throwJSONRPC2Error(JSONRPC2Error.INVALID_PARAMS, Constants.Errors.ACTION_NOT_ALLOWED);
        }

        if(thread == null){
            responseParams.put(Constants.Param.Status.STATUS, Constants.Param.Status.OBJECT_NOT_FOUND);
            return;
        }

        if(headline != null){
            thread.setHeadLine(headline);
        }

        if(text != null){
            thread.setText(text);
        }

        persistObjects(thread);
        responseParams.put(Constants.Param.Status.STATUS, Constants.Param.Status.SUCCESS);
        responseParams.put(Constants.Param.Name.THREAD, serialize(thread));
    }