type is now method in ajax