Updated to use attributes for logs and apikey