1) move component url to directive 2) refactor get api