adds loading bar for ajax requests