Added JSON and XHR support for main page