Updated JS according to JSON API changes