Effect of higher-order nonlinearities on amplification and squeezing in Josephson parametric amplifiers