Did a bunch of js api stuff.