update API, by replacing $node with $entity
add jsdoc