Introduce API to solve the 'last successful for X' query