js api stuff