Updated to use the JSON API