Made it swing with new version of WP JSON API.
Replaced old code.