Fixed API running even if there are errors