changing return type to json