The polynomial method and the restriction problem