using javascript to query the data layer