converted to promises, added URIjs for consitent url building