Added killing of subprocesses after the call and incorporated headline getting in the flask server