sorted ajax requests based on categories