Measurement of cosmic ray electrons and positrons with the AMS-02 experiment