def filtered_response response
      raise Skydrive::Error.new({"code" => "no_response_received", "message" => "Request didn't make through or response not received"}) unless response
      if response.success?
        filtered_response = response.parsed_response
        if response.response.code =~ /(201|200)/
          raise Skydrive::Error.new(filtered_response["error"]) if filtered_response["error"]
          if filtered_response["data"]
            return Skydrive::Collection.new(self, filtered_response["data"])            
          elsif filtered_response["id"] && (filtered_response["id"].match /^comment\..+/)
            return Skydrive::Comment.new(self, filtered_response)
          elsif filtered_response["id"] && (filtered_response["id"].match /^file\..+/)
            return Skydrive::File.new(self, filtered_response)
          elsif filtered_response["type"]
            return "Skydrive::#{filtered_response["type"].capitalize}".constantize.new(self, filtered_response)
          else
            return filtered_response
          end
        else
          return true
        end
      else
        raise Skydrive::Error.new("code" => "http_error_#{response.response.code}", "message" => response.response.message)
      end
    end
def filtered_response response
      raise Skydrive::Error.new({"code" => "no_response_received", "message" => "Request didn't make through or response not received"}) unless response
      if response.success?
        filtered_response = response.parsed_response
        if response.response.code =~ /(201|200)/
          raise Skydrive::Error.new(filtered_response["error"]) if filtered_response["error"]
          if filtered_response["data"]
            return Skydrive::Collection.new(self, filtered_response["data"])            
          elsif filtered_response["id"] && (filtered_response["id"].match /^comment\..+/)
            return Skydrive::Comment.new(self, filtered_response)
          elsif filtered_response["id"] && (filtered_response["id"].match /^file\..+/)
            return Skydrive::File.new(self, filtered_response)
          elsif filtered_response["type"]
            return "Skydrive::#{filtered_response["type"].capitalize}".constantize.new(self, filtered_response)
          else
            return filtered_response
          end
        else
          return true
        end
      else
        raise Skydrive::Error.new("code" => "http_error_#{response.response.code}", "message" => response.response.message)
      end
    end
Filter the response after checking for any errors