Fixed API and clear error log on every restart