anchor.diff:  add_data() ->
   	inets:start(),
   	%% Create Users, assumes Webmachine is running on same computer
  -	{ok, {{_Version1, 200, _ReasonPhrase1}, _Headers1, Body1}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Tomas\"}"}, [], []),
  -	{ok, {{_Version2, 200, _ReasonPhrase2}, _Headers2, Body2}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Alberto\"}"}, [], []),
  -	{ok, {{_Version3, 200, _ReasonPhrase3}, _Headers3, Body3}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Quentin\"}"}, [], []),
  -	{ok, {{_Version4, 200, _ReasonPhrase4}, _Headers4, Body4}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Andreas\"}"}, [], []),
  -	{ok, {{_Version5, 200, _ReasonPhrase5}, _Headers5, Body5}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Jacob\"}"}, [], []),
  +	{ok, {{_Version1, 200, _ReasonPhrase1}, _Headers1, Body1}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Tomas\",\"private\":\"false\"}"}, [], []),
  +	{ok, {{_Version2, 200, _ReasonPhrase2}, _Headers2, Body2}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Alberto\",\"private\":\"false\"}"}, [], []),
  +	{ok, {{_Version3, 200, _ReasonPhrase3}, _Headers3, Body3}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Quentin\",\"private\":\"false\"}"}, [], []),
  +	{ok, {{_Version4, 200, _ReasonPhrase4}, _Headers4, Body4}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Andreas\",\"private\":\"false\"}"}, [], []),
  +	{ok, {{_Version5, 200, _ReasonPhrase5}, _Headers5, Body5}} = httpc:request(post, {"http://localhost:8000/users", [],"application/json", "{\"username\":\"Jacob\",\"private\":\"false\"}"}, [], []),
   	User1 = lib_json:get_field(Body1,"_id"),
   	User2 = lib_json:get_field(Body2,"_id"),
   	User3 = lib_json:get_field(Body3,"_id"),
   	User4 = lib_json:get_field(Body4,"_id"),
   	_User5 = lib_json:get_field(Body5,"_id"),
  -	
  +
   	%% Create resources for user1
  -	{ok, {{_Version6, 200, _ReasonPhrase6}, _Headers6, Body6}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User1 ++"\",\"name\":\"Resource1\",\"tags\":\"[temperature,Uppsala]\",\"description\":\"Temperature in Uppsala\",\"type\":\"Temperature\",\"manufacturer\":\"Ericsson\",\"model\":\"MES013\",\"make\":\"\",\"serial\":\"0943123\",\"location\":\"59.8581,17.6447\",\"active\":\"true\",\"uri\":\"http://uppsala.com\",\"polling_freq\":\"20\",\"creation_date\":\"2013-09-23\"}"}, [], []),
  -	{ok, {{_Version7, 200, _ReasonPhrase7}, _Headers7, Body7}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User1 ++"\",\"name\":\"Resource2\",\"tags\":\"[temperature,Norrtalje]\",\"description\":\"Temperature in Norrtalje\",\"type\":\"Temperature\",\"manufacturer\":\"Ericsson\",\"model\":\"MES013\",\"make\":\"\",\"serial\":\"0943124\",\"location\":\"59.7667,18.7000\",\"active\":\"true\",\"uri\":\"http://norrtalje.com\",\"polling_freq\":\"20\",\"creation_date\":\"2013-09-23\"}"}, [], []),
  -	{ok, {{_Version8, 200, _ReasonPhrase8}, _Headers8, Body8}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User1 ++"\",\"name\":\"Resource3\",\"tags\":\"[temperature,Sala]\",\"description\":\"Temperature in Sala\",\"type\":\"Temperature\",\"manufacturer\":\"Ericsson\",\"model\":\"MES013\",\"make\":\"\",\"serial\":\"0943125\",\"location\":\"59.9167,16.6000\",\"active\":\"true\",\"uri\":\"http://sala.com\",\"polling_freq\":\"20\",\"creation_date\":\"2013-09-23\"}"}, [], []),
  +	{ok, {{_Version6, 200, _ReasonPhrase6}, _Headers6, Body6}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ lib_json:to_string(User1) ++"\",\"name\":\"Resource1\",\"tags\":\"[temperature,Uppsala]\",\"description\":\"Temperature in Uppsala\",\"type\":\"Temperature\",\"manufacturer\":\"Ericsson\",\"model\":\"MES013\",\"make\":\"\",\"serial\":\"0943123\",\"location\":\"59.8581,17.6447\",\"active\":\"true\",\"uri\":\"http://uppsala.com\",\"polling_freq\":\"20\"}"}, [], []),
  +	{ok, {{_Version7, 200, _ReasonPhrase7}, _Headers7, Body7}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ lib_json:to_string(User1) ++"\",\"name\":\"Resource2\",\"tags\":\"[temperature,Norrtalje]\",\"description\":\"Temperature in Norrtalje\",\"type\":\"Temperature\",\"manufacturer\":\"Ericsson\",\"model\":\"MES013\",\"make\":\"\",\"serial\":\"0943124\",\"location\":\"59.7667,18.7000\",\"active\":\"true\",\"uri\":\"http://norrtalje.com\",\"polling_freq\":\"20\"}"}, [], []),
  +	{ok, {{_Version8, 200, _ReasonPhrase8}, _Headers8, Body8}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ lib_json:to_string(User1) ++"\",\"name\":\"Resource3\",\"tags\":\"[temperature,Sala]\",\"description\":\"Temperature in Sala\",\"type\":\"Temperature\",\"manufacturer\":\"Ericsson\",\"model\":\"MES013\",\"make\":\"\",\"serial\":\"0943125\",\"location\":\"59.9167,16.6000\",\"active\":\"true\",\"uri\":\"http://sala.com\",\"polling_freq\":\"20\"}"}, [], []),
   	U1Resource1 = lib_json:get_field(Body6,"_id"),
   	U1Resource2 = lib_json:get_field(Body7,"_id"),
   	U1Resource3 = lib_json:get_field(Body8,"_id"),
   	
   	%% Create streams for resource1 for user1
  -	{ok, {{_Version9, 200, _ReasonPhrase9}, _Headers9, Body9}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U1Resource1 ++"\",\"name\":\"Stream1\",\"tags\":\"[temperature,celsius,Uppsala]\",\"description\":\"Temperature in Celsius in Uppsala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"celsius\",\"accuracy\":0.95,\"min_val\":-50.0,\"max_val\":50.0,\"active\":\"true\",\"user_ranking\":10.0,\"subscribers\":60,\"last_updated\":\"2013-10-05T010502.0000\", \"creation_date\":\"2013-10-01\",\"history_size\": 5000,\"location\":\"59.8581,17.6447\"}"}, [], []),
  -	{ok, {{_Version10, 200, _ReasonPhrase10}, _Headers10, Body10}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U1Resource1 ++"\",\"name\":\"Stream2\",\"tags\":\"[temperature,kelvin,Uppsala]\",\"description\":\"Temperature in Kelvin in Uppsala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"kelvin\",\"accuracy\":0.95,\"min_val\":150.0,\"max_val\":350.0,\"active\":\"true\",\"user_ranking\":10.0,\"subscribers\":655,\"last_updated\":\"2013-10-07T010909.0000\", \"creation_date\":\"2013-10-01\",\"history_size\": 10000,\"location\":\"59.8581,17.6447\"}"}, [], []),
  +	{ok, {{_Version9, 200, _ReasonPhrase9}, _Headers9, Body9}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ lib_json:to_string(U1Resource1) ++"\",\"name\":\"Stream1\",\"tags\":\"[temperature,celsius,Uppsala]\",\"description\":\"Temperature in Celsius in Uppsala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"celsius\",\"accuracy\":0.95,\"min_val\":-50.0,\"max_val\":50.0,\"active\":\"true\",\"location\":\"59.8581,17.6447\"}"}, [], []),
  +	{ok, {{_Version10, 200, _ReasonPhrase10}, _Headers10, Body10}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ lib_json:to_string(U1Resource1) ++"\",\"name\":\"Stream2\",\"tags\":\"[temperature,kelvin,Uppsala]\",\"description\":\"Temperature in Kelvin in Uppsala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"kelvin\",\"accuracy\":0.95,\"min_val\":150.0,\"max_val\":350.0,\"active\":\"true\",\"location\":\"59.8581,17.6447\"}"}, [], []),
   	U1R1Stream1 = lib_json:get_field(Body9,"_id"),
   	U1R1Stream2 = lib_json:get_field(Body10,"_id"),
   	
  
positive.code: 	Value = math:sin(Amount/10.0) + (random:uniform()/10.0),
  	UsedValue = float_to_list(Value,[{decimals,3}]),
  	%% Unsure if this is how the datapoints should look
  	JSON = "{\"stream_id\":\""++ StreamId++"\",\"timestamp\":\"" ++ TimeStamp ++ "\",\"value\":"++ UsedValue ++"}",
  	{ok, {{_Version, _Code, _ReasonPhrase}, _Headers, _Body}} = httpc:request(post, {"http://localhost:8000/streams/" ++ StreamId ++ "/data", [],"application/json", JSON}, [], []),
  	timer:sleep(Delay),
  	sinus_random_data(Amount-1,StreamId,Delay).
  
  
negative.code: 	sinus_random_data(15,U2R1Stream3,1000),
  		
  	%% Create stream for resource2 for user2
  	{ok, {{_Version20, 200, _ReasonPhrase20}, _Headers20, Body20}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ lib_json:to_string(U2Resource2) ++"\",\"name\":\"Stream1\",\"tags\":\"[water-level,Uppsala]\",\"description\":\"Water-level in Fyrisan in Uppsala\",\"private\":\"true\",\"type\":\"Water-level\",\"unit\":\"meter\",\"accuracy\":0.95,\"min_val\":0.0,\"max_val\":15.0,\"active\":\"true\",\"location\":\"59.8581,17.6447\"}"}, [], []),
  	U2R2Stream1 = lib_json:get_field(Body20,"_id"),
  	
  	%% Add random data between min and max for the streams
  