Updated with JS get requests for data, legend