diff --git a/lib/ocs/activity.php b/lib/ocs/activity.php
index 3b090376e720b9b9083f041b3540b5d357693e79..07b571665ec6981e111dc604c4929cc3b9123a4b 100644
--- a/lib/ocs/activity.php
+++ b/lib/ocs/activity.php
@@ -5,7 +5,4 @@ class OC_OCS_Activity {
 	public static function activityGet($parameters){
 		// TODO
 	}
-	
 }
-
-?>
\ No newline at end of file
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index d0cd72e98c55362897e0f990e1935ea6f455c13a..2f2aad714a3052d1fb795778f2254c9db4becf43 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -2,8 +2,8 @@
 
 class OC_OCS_Cloud {
 
-	public static function systemwebapps($parameters){
-		$login = OC_OCS::checkpassword();
+	public static function getSystemWebApps($parameters){
+		OC_Util::checkLoggedIn();
 		$apps = OC_App::getEnabledApps();
 		$values = array();
 		foreach($apps as $app) {
@@ -16,9 +16,10 @@ class OC_OCS_Cloud {
 		return $values;
 	}
 	
-	public static function getQuota($parameters){
-		$login=OC_OCS::checkpassword();
-		if(OC_Group::inGroup($login, 'admin') or ($login==$parameters['user'])) {
+	public static function getUserQuota($parameters){
+		OC_Util::checkLoggedIn();
+		$user = OC_User::getUser();
+		if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) {
 
 			if(OC_User::userExists($parameters['user'])){
 				// calculate the disc space
@@ -47,9 +48,10 @@ class OC_OCS_Cloud {
 		}
 	}
 	
-	public static function setQuota($parameters){
-		$login=OC_OCS::checkpassword();
-		if(OC_Group::inGroup($login, 'admin')) {
+	public static function setUserQuota($parameters){
+		OC_Util::checkLoggedIn();
+		$user = OC_User::getUser();
+		if(OC_Group::inGroup($user, 'admin')) {
 		
 			// todo
 			// not yet implemented
@@ -63,8 +65,8 @@ class OC_OCS_Cloud {
 		}
 	}
 	
-	public static function getPublickey($parameters){
-		$login=OC_OCS::checkpassword();
+	public static function getUserPublickey($parameters){
+		OC_Util::checkLoggedIn();
 
 		if(OC_User::userExists($parameters['user'])){
 			// calculate the disc space
@@ -75,23 +77,20 @@ class OC_OCS_Cloud {
 		}
 	}
 	
-	public static function getPrivatekey($parameters){
-		$login=OC_OCS::checkpassword();
-        if(OC_Group::inGroup($login, 'admin') or ($login==$parameters['user'])) {
+	public static function getUserPrivatekey($parameters){
+		OC_Util::checkLoggedIn();
+		$user = OC_User::getUser();
+		if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) {
 
-                if(OC_User::userExists($user)){
-                        // calculate the disc space
-                        $txt='this is the private key of '.$parameters['user'];
-                        echo($txt);
-                }else{
-                        echo self::generateXml('', 'fail', 300, 'User does not exist');
-                }
-        }else{
-                echo self::generateXml('', 'fail', 300, 'You don´t have permission to access this ressource.');
-        }
+			if(OC_User::userExists($user)){
+				// calculate the disc space
+				$txt='this is the private key of '.$parameters['user'];
+				echo($txt);
+			}else{
+				echo self::generateXml('', 'fail', 300, 'User does not exist');
+			}
+		}else{
+			echo self::generateXml('', 'fail', 300, 'You don´t have permission to access this ressource.');
+		}
 	}
-	
-	
 }
-
-?>
\ No newline at end of file
diff --git a/lib/ocs/config.php b/lib/ocs/config.php
index b736abe3b9cf5752222267c61b2555bc721a5ef6..06103cbeb4f5ef2f6209ff010cbc7ae15567d39f 100644
--- a/lib/ocs/config.php
+++ b/lib/ocs/config.php
@@ -10,7 +10,4 @@ class OC_OCS_Config {
 		$xml['ssl'] = 'false';
 		return $xml;
 	}
-	
 }
-
-?>
\ No newline at end of file
diff --git a/lib/ocs/person.php b/lib/ocs/person.php
index f4e4be5ee0913045c7ba14c8068111fa4438f9fd..629a7c2e6c793a58e4b62839ddb87d7de301882a 100644
--- a/lib/ocs/person.php
+++ b/lib/ocs/person.php
@@ -14,9 +14,5 @@ class OC_OCS_Person {
 		}else{
 			return 101;
 		}
-		
 	}
-	
 }
-
-?>
\ No newline at end of file
diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php
index 772140469111f2ef998a7d956f50a3377fdf826a..1c781dece8ab73f1d73902b773e03f8a067a7cf2 100644
--- a/lib/ocs/privatedata.php
+++ b/lib/ocs/privatedata.php
@@ -2,8 +2,8 @@
 
 class OC_OCS_Privatedata {
 
-	public static function privatedataGet($parameters){
-		// TODO check user auth
+	public static function get($parameters){
+		OC_Util::checkLoggedIn();
 		$user = OC_User::getUser();
 		$app = addslashes(strip_tags($parameters['app']));
 		$key = addslashes(strip_tags($parameters['key']));
@@ -18,15 +18,22 @@ class OC_OCS_Privatedata {
 		//TODO: replace 'privatedata' with 'attribute' once a new libattice has been released that works with it
 	}
 	
-	public static function privatedataSet($parameters){
-		$user = OC_OCS::checkpassword();
+	public static function set($parameters){
+		OC_Util::checkLoggedIn();
+		$user = OC_User::getUser();
+		$app = addslashes(strip_tags($parameters['app']));
+		$key = addslashes(strip_tags($parameters['key']));
+		$value = OC_OCS::readData('post', 'value', 'text');
 		if(OC_OCS::setData($user,$app,$key,$value)){
 			return 100;
 		}
 	}
 	
-	public static function privatedataDelete($parameteres){
-		$user = OC_OCS::checkpassword();
+	public static function delete($parameters){
+		OC_Util::checkLoggedIn();
+		$user = OC_User::getUser();
+		$app = addslashes(strip_tags($parameters['app']));
+		$key = addslashes(strip_tags($parameters['key']));
 		if($key=="" or $app==""){
 			return; //key and app are NOT optional here
 		}
@@ -34,7 +41,4 @@ class OC_OCS_Privatedata {
 			return 100;
 		}
 	}
-	
 }
-
-?>
diff --git a/ocs/routes.php b/ocs/routes.php
index a913254ebe849c1e02adc4c1b8746c375208b4c8..95df0c7ec91cbde61a2831f8fcb6e7af342cac50 100644
--- a/ocs/routes.php
+++ b/ocs/routes.php
@@ -12,14 +12,14 @@ OC_API::register('post', '/person/check', array('OC_OCS_Person', 'check'), 'ocs'
 // Activity
 OC_API::register('get', '/activity', array('OC_OCS_Activity', 'activityGet'), 'ocs');
 // Privatedata
-OC_API::register('get', '/privatedata/getattribute/{app}/{key}', array('OC_OCS_Privatedata', 'privatedataGet'), 'ocs');
-OC_API::register('post', '/privatedata/setattribute/{app}/{key}', array('OC_OCS_Privatedata', 'privatedataPut'), 'ocs');
-OC_API::register('post', '/privatedata/deleteattribute/{app}/{key}', array('OC_OCS_Privatedata', 'privatedataDelete'), 'ocs');
+OC_API::register('get', '/privatedata/getattribute/{app}/{key}', array('OC_OCS_Privatedata', 'get'), 'ocs');
+OC_API::register('post', '/privatedata/setattribute/{app}/{key}', array('OC_OCS_Privatedata', 'set'), 'ocs');
+OC_API::register('post', '/privatedata/deleteattribute/{app}/{key}', array('OC_OCS_Privatedata', 'delete'), 'ocs');
 // Cloud
-OC_API::register('get', '/cloud/system/webapps', array('OC_OCS_Cloud', 'systemwebapps'), 'ocs');
-OC_API::register('get', '/cloud/user/{user}', array('OC_OCS_Cloud', 'getQuota'), 'ocs');
-OC_API::register('post', '/cloud/user/{user}', array('OC_OCS_Cloud', 'setQuota'), 'ocs');
-OC_API::register('get', '/cloud/user/{user}/publickey', array('OC_OCS_Cloud', 'getPublicKey'), 'ocs');
-OC_API::register('get', '/cloud/user/{user}/privatekey', array('OC_OCS_Cloud', 'getPrivateKey'), 'ocs');
+OC_API::register('get', '/cloud/system/webapps', array('OC_OCS_Cloud', 'getSystemWebApps'), 'ocs');
+OC_API::register('get', '/cloud/user/{user}', array('OC_OCS_Cloud', 'getUserQuota'), 'ocs');
+OC_API::register('post', '/cloud/user/{user}', array('OC_OCS_Cloud', 'setUserQuota'), 'ocs');
+OC_API::register('get', '/cloud/user/{user}/publickey', array('OC_OCS_Cloud', 'getUserPublicKey'), 'ocs');
+OC_API::register('get', '/cloud/user/{user}/privatekey', array('OC_OCS_Cloud', 'getUserPrivateKey'), 'ocs');
 
 ?>