Perturbative calculation of quasi-potential and applications to particle systems with mean-field interactions