partial refactor of sunlight api queries to backend