handle generate controller for RPC