Play with json api

Convert AJAX to use JSON API