Added energy logging and API methods to retrieve logs