Fixing server call, moving js to local file