moved pathway data retrieval code to service