JS, API updates

JS now works for all functions (still has some bugs)
REST API updated with another branch