How to create api on long running task?

I am trying to create an api on top of long running task. So I need to implement full queue system where I can keep track of task like On creation send 201, accepted 202 and whole pipeline. I also want to keep track of request and callback implementation as well.

I have searched various places but not able to implement this stuff.

Something like this? You could build off the example here.