added ajax support and loading bar