check for response.code, fix to use File.expand_path, and removed pry