If upon the hearing which shall be tried de novo it shall appear to the court that testimony is necessary for the proper disposition of the matter, it may take evidence or appoint a referee to take such evidence as it may direct and report the same to the court with the referee’s findings of fact and conclusions of law, which shall constitute a part of the proceedings upon which the determination of the court shall be made.  The court may reverse or affirm, wholly or partly, or may modify the decision brought up for review.

   Costs shall not be allowed against the board unless it shall appear to the court that it acted with gross negligence or in bad faith or with malice in making the decision appealed from.