Added getFirstObjectOfType API