Add openTask and closeTask jsonrpc API.