Define handler for post requests to /tasks