Adjustments to use the new JSON API

Made changes in order to use the new JSON API