Implemented some code that will handle API interfacing via JS.