anchor.diff:  send_authed_query(#state{storage_url = _URL, token = _AuthToken} = State, PathInfo, Headers,  Method) ->
   	send_authed_query(State, PathInfo, Headers, Method, []).
   
  -send_authed_query(#state{storage_url = URL, token = AuthToken}, PathInfo, Headers,  Method, Body) ->	
  -	ibrowse:send_req(URL ++ PathInfo, [{"X-Auth-Token", AuthToken} | Headers], Method, Body).
  +send_authed_query(#state{storage_url = _URL, token = _AuthToken} = State, PathInfo, Headers,  Method, Body) ->
  +	send_authed_query(State, PathInfo, Headers, Method, Body, []).
  +
  +send_authed_query(#state{storage_url = URL, token = AuthToken}, PathInfo, Headers,  Method, Body, Options) ->	  
  +	ibrowse:send_req(URL ++ PathInfo, [{"X-Auth-Token", AuthToken} | Headers], Method, Body, Options).
   
   %%
   %% Extract a header from a list of items header items
  
positive.code: 		_ -> error
  	end.
  
  %%
  %% Sends a simple authed query to the server with a passed method
  %%
  
negative.code: 		_ -> error
  	end.
  
  upload_object(State, Container, Object, FileName) ->
  	upload_object(State, Container, Object, FileName, [], []).
  
  upload_object(State, Container, Object, FileName, Metadata) ->
  	upload_object(State, Container, Object, FileName, Metadata,[]).
  
  upload_object(State, Container, Object, FileName, Metadata, Options) ->
  	case file:read_file(FileName) of
  		{ok, FileData} ->
  			create_object(State, Container, Object, FileData, Metadata, Options);
  		{error, ErrorMessage} -> {error, ErrorMessage};
  		_ -> error
  	end.
  
  create_object(State, Container, Object, Data) ->
  	create_object(State, Container, Object, Data, [], []).
  
  create_object(State, Container, Object, Data, Metadata) ->
  	create_object(State, Container, Object, Data, Metadata, []).
  
  create_object(State, Container, Object, Data, Metadata, Options) ->
  	%get any options that will be passed to ibrowse (chunked etc.)
  	ConnOptions = get_object_options(Options),
  	
  	% Compress the object if required
  	NewData = compress_object(Data, Options),
  	
  	%calculate an MD5 hash of the object and append any headers (metadata) etc.
  	Headers = [{"Etag", md5(NewData)}] ++ get_object_headers(Options) ++ create_metadata_headers("X-Object-Meta-", Metadata),
  	io:format("~p~n", [Headers]),
  	{ok, Code, _Header, _Content} = send_authed_query(State, "/" ++ Container ++ "/" ++ Object, Headers, put, NewData, ConnOptions),
  
  	case list_to_integer(Code) of
  		201 -> ok;
  