Fix paths for phonegap. Add REST client for m2m API.