spa and api