Complete js functions for v1