Move json encoding into BoatdHTTPServer