Added support for AJAX requests

Returns JSON formatted data for AJAX requests.
Fixed issue with template tags not being available for initial page load