refactor: plugins.rest to use a common restify handler that can handle initialization