def check_response(response)
      case response.code
        when 200, 201
          true
        when 401
          raise Calculated::Session::PermissionDenied.new("Your Request could not be authenticated is your api key valid?")
        when 404
          raise Calculated::Session::NotFound.new("Resource was not found")
        when 412
          raise Calculated::Session::MissingParameter.new("Missing Parameter: #{response.body}")
        else
          raise Calculated::Session::UnknownError.new("super strange type unknown error: #{response.code} :body #{response.body}")
      end
    end
def check_response(response)
      case response.code
        when 200, 201
          true
        when 401
          raise Calculated::Session::PermissionDenied.new("Your Request could not be authenticated is your api key valid?")
        when 404
          raise Calculated::Session::NotFound.new("Resource was not found")
        when 412
          raise Calculated::Session::MissingParameter.new("Missing Parameter: #{response.body}")
        else
          raise Calculated::Session::UnknownError.new("super strange type unknown error: #{response.code} :body #{response.body}")
      end
    end
checking the status code of the response; if we are not authenticated
 then authenticate the session
 @raise [Calculated::PermissionDenied] if the status code is 403
 @raise [Calculated::SessionExpired] if a we get a 401
 @raise [Calculated::MissingParameter] if we get something strange