anchor.diff:  	sinus_random_data(15,U1R2Stream2,1000),
   	
   	%% Create streams for resource3 for user1
  -	{ok, {{_Version13, 200, _ReasonPhrase13}, _Headers13, Body13}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U1Resource3 ++"\",\"name\":\"Stream1\",\"tags\":\"[temperature,celsius,Sala]\",\"description\":\"Temperature in Celsius in Sala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"celsius\",\"accuracy\":0.95,\"min_val\":-50.0,\"max_val\":50.0,\"active\":\"true\",\"user_ranking\":10.0,\"subscribers\":16,\"last_updated\":\"2013-10-05T010502.0000\", \"creation_date\":\"2013-10-01\",\"history_size\": 5000,\"location\":\"59.9167,16.6000\"}"}, [], []),
  -	{ok, {{_Version14, 200, _ReasonPhrase14}, _Headers14, Body14}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U1Resource3 ++"\",\"name\":\"Stream2\",\"tags\":\"[temperature,kelvin,Sala]\",\"description\":\"Temperature in Kelvin in Sala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"kelvin\",\"accuracy\":0.95,\"min_val\":150.0,\"max_val\":350.0,\"active\":\"true\",\"user_ranking\":10.0,\"subscribers\":155,\"last_updated\":\"2013-10-07T010909.0000\", \"creation_date\":\"2013-10-01\",\"history_size\": 10000,\"location\":\"59.9167,16.6000\"}"}, [], []),
  +	{ok, {{_Version13, 200, _ReasonPhrase13}, _Headers13, Body13}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ lib_json:to_string(U1Resource3) ++"\",\"name\":\"Stream1\",\"tags\":\"[temperature,celsius,Sala]\",\"description\":\"Temperature in Celsius in Sala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"celsius\",\"accuracy\":0.95,\"min_val\":-50.0,\"max_val\":50.0,\"active\":\"true\",\"location\":\"59.9167,16.6000\"}"}, [], []),
  +	{ok, {{_Version14, 200, _ReasonPhrase14}, _Headers14, Body14}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ lib_json:to_string(U1Resource3) ++"\",\"name\":\"Stream2\",\"tags\":\"[temperature,kelvin,Sala]\",\"description\":\"Temperature in Kelvin in Sala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"kelvin\",\"accuracy\":0.95,\"min_val\":150.0,\"max_val\":350.0,\"active\":\"true\",\"location\":\"59.9167,16.6000\"}"}, [], []),
   	U1R3Stream1 = lib_json:get_field(Body13,"_id"),
   	U1R3Stream2 = lib_json:get_field(Body14,"_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: 	
  
  	%% Create resource for user3
  	{ok, {{_Version21, 200, _ReasonPhrase21}, _Headers21, Body21}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User3 ++"\",\"name\":\"Resource1\",\"tags\":\"[water-level,Uppsala]\",\"description\":\"Water-level in Uppsala\",\"type\":\"Water-level\",\"manufacturer\":\"Ericsson\",\"model\":\"WLS044\",\"make\":\"\",\"serial\":\"09442358\",\"location\":\"59.8581,17.6447\",\"active\":\"true\",\"uri\":\"http://uppsala.com\",\"polling_freq\":\"40\"}"}, [], []),
  	U3Resource1 = lib_json:get_field(Body21,"_id"),
  	
  	%% Create stream for resource1 for user3
  	{ok, {{_Version22, 200, _ReasonPhrase22}, _Headers22, Body22}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U3Resource1 ++"\",\"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\"}"}, [], []),
  	U3R1Stream1 = lib_json:get_field(Body22,"_id"),
  	
  	%% Add random data between min and max for the streams
  	sinus_random_data(15,U3R1Stream1,1000),
  
  	%% Create resources for user4
  	{ok, {{_Version23, 200, _ReasonPhrase23}, _Headers23, Body23}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User4 ++"\",\"name\":\"Resource1\",\"tags\":\"[water-level,Uppsala]\",\"description\":\"Water-level in Uppsala\",\"type\":\"Water-level\",\"manufacturer\":\"Ericsson\",\"model\":\"WLA099\",\"make\":\"\",\"serial\":\"AACV223\",\"location\":\"59.8581,17.6447\",\"active\":\"true\",\"uri\":\"http://uppsala.com\",\"polling_freq\":\"60\"}"}, [], []),
  	{ok, {{_Version24, 200, _ReasonPhrase24}, _Headers24, Body24}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User4 ++"\",\"name\":\"Resource2\",\"tags\":\"[water-level,Norrtalje]\",\"description\":\"Water-level in Norrtalje\",\"type\":\"Water-level\",\"manufacturer\":\"Ericsson\",\"model\":\"WLA099\",\"make\":\"\",\"serial\":\"AACV224\",\"location\":\"59.7667,18.7000\",\"active\":\"true\",\"uri\":\"http://norrtalje.com\",\"polling_freq\":\"60\"}"}, [], []),
  	{ok, {{_Version25, 200, _ReasonPhrase25}, _Headers25, Body25}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User4 ++"\",\"name\":\"Resource3\",\"tags\":\"[water-level,Sala]\",\"description\":\"Water-level in Sala\",\"type\":\"Water-level\",\"manufacturer\":\"Ericsson\",\"model\":\"WLA099\",\"make\":\"\",\"serial\":\"AACV225\",\"location\":\"59.9167,16.6000\",\"active\":\"true\",\"uri\":\"http://sala.com\",\"polling_freq\":\"60\"}"}, [], []),
  	{ok, {{_Version26, 200, _ReasonPhrase26}, _Headers26, Body26}} = httpc:request(post, {"http://localhost:8000/resources", [],"application/json", "{\"user_id\":\""++ User4 ++"\",\"name\":\"Resource4\",\"tags\":\"[water-level,Stockholm]\",\"description\":\"Water-level in Stockholm\",\"type\":\"Water-level\",\"manufacturer\":\"Ericsson\",\"model\":\"WLA099\",\"make\":\"\",\"serial\":\"AACV227\",\"location\":\"59.3294,18.0686\",\"active\":\"true\",\"uri\":\"http://stockholm.com\",\"polling_freq\":\"60\"}"}, [], []),
  	U4Resource1 = lib_json:get_field(Body23,"_id"),
  	U4Resource2 = lib_json:get_field(Body24,"_id"),
  	U4Resource3 = lib_json:get_field(Body25,"_id"),
  	U4Resource4 = lib_json:get_field(Body26,"_id"),
  	
  	%% Create stream for resource1 for user4
  	{ok, {{_Version27, 200, _ReasonPhrase27}, _Headers27, Body27}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U4Resource1 ++"\",\"name\":\"Stream1\",\"tags\":\"[water-level,Uppsala]\",\"description\":\"Water-level in Fyrisan in Uppsala\",\"private\":\"false\",\"type\":\"Water-level\",\"unit\":\"meter\",\"accuracy\":0.85,\"min_val\":0.0,\"max_val\":19.0,\"active\":\"true\",\"location\":\"59.8581,17.6447\"}"}, [], []),
  	U4R1Stream1 = lib_json:get_field(Body27,"_id"),
  	
  	%% Add random data between min and max for the streams
  	sinus_random_data(15,U4R1Stream1,1000),
  	
  	%% Create stream for resource2 for user4
  	{ok, {{_Version28, 200, _ReasonPhrase28}, _Headers28, Body28}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U4Resource2 ++"\",\"name\":\"Stream1\",\"tags\":\"[water-level,Norrtalje]\",\"description\":\"Water-level in Nortaljean in Uppsala\",\"private\":\"false\",\"type\":\"Water-level\",\"unit\":\"meter\",\"accuracy\":0.95,\"min_val\":0.0,\"max_val\":10.0,\"active\":\"true\",\"location\":\"59.7667,18.7000\"}"}, [], []),
  	U4R2Stream1 = lib_json:get_field(Body28,"_id"),
  	
  	%% Add random data between min and max for the streams
  	sinus_random_data(15,U4R2Stream1,1000),
  
  	%% Create stream for resource3 for user4
  	{ok, {{_Version29, 200, _ReasonPhrase29}, _Headers29, Body29}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U4Resource3 ++"\",\"name\":\"Stream1\",\"tags\":\"[water-level,Sala]\",\"description\":\"Water-level in the spring in Sala\",\"private\":\"false\",\"type\":\"Water-level\",\"unit\":\"meter\",\"accuracy\":0.75,\"min_val\":0.0,\"max_val\":9.0,\"active\":\"true\",\"location\":\"59.9167,16.6000\"}"}, [], []),
  	U4R3Stream1 = lib_json:get_field(Body29,"_id"),
  	
  	%% Add random data between min and max for the streams
  	sinus_random_data(15,U4R3Stream1,1000),
  
  	%% Create stream for resource4 for user4
  	{ok, {{_Version30, 200, _ReasonPhrase30}, _Headers30, Body30}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U4Resource4 ++"\",\"name\":\"Stream1\",\"tags\":\"[water-level,Stockholm]\",\"description\":\"Water-level in the spring in Stockholm\",\"private\":\"false\",\"type\":\"Water-level\",\"unit\":\"meter\",\"accuracy\":0.97,\"min_val\":0.0,\"max_val\":22.0,\"active\":\"true\",\"location\":\"59.3294,18.0686\"}"}, [], []),
  	U4R4Stream1 = lib_json:get_field(Body30,"_id"),
  	
  	%% Add random data between min and max for the streams
  