added URL string encoding; added completion handlers