Import gui and json only if needed.