setting up the spaModel, and calling the api