First attempt at implementing this with the latest JSON API.
Updated read me to reflect the latest changes.