Fix ajax error. Rename param method => type