separation of javascript, continued work incorporating new API