Move all log manipulation to the api