Add sub-domain support and change json schema