Added suncalc and api function