Add ajax support and templates