add deploy/undeploy
create correct uri after PUT
refactored plan building
renamed VersionsGateway to Repository and more