Ajax in Kirby Controller

Check out this post for using json and to use your ajax script outside of a template (though not in a controller) Where can I save my PHP-Files for AJAX?