making js API consistent with sh API