fix compute total and create json object for expences