Battery API example