Use promises for checking directory containment.
Update file response to use promises.