Improved logic. Updated JSON. Now templates are checked by router.