Use xhr for ajax request