almost finished with basic energy api