On the restriction of the Fourier transform to curves: endpoint results and the degenerate case