Energy flow, thermoelectricity and Fourier's law at the nanoscale