please add API doc to both methods (prefixed “Scala API:”)