code for get & post of candidates