Got ajax working finally.