Convert file loading to use ajax requests