Fix API history request

Used wrong variable 'ep' instead of 'row'