rewrite of charge handling, additional api support