this is the api a user needs to code for non-batch processing.