Ajax working, starting to implement sync javascript