Hooked up api calls, cleaned up the JS

Build the spoke calculation in javascript.