Added support for the new spaceapi version
Merged with the master branch.