make api endpoint injectable in helper functions