Continuous one-flow multi-step synthesis of active pharmaceutical ingredients