It seems that this function is not called from any place in the code... I think is a leftover from the times we support the `--rest` CLI argument. In that case, I'd suggest to remove this function completely from code.