should handle nil having already been written in any rpc call before writing it again causing invalid json to be returned.