diff --git a/apps.api.php b/apps.api.php
index 4b30528..6f55eb8 100644
--- a/apps.api.php
+++ b/apps.api.php
@@ -1,80 +1,89 @@
 <?php
+/**
+ * @file The API for the Apps module.
+ */
 
-/*
- * provide configureation information to the apps about an enabled app
+/**
+ * Provides configuration information to the apps about an enabled app
  *
- * One can register demo content as a sepeate module or as a set of callbacks
- * hook_apps_app_info is a hook that will only be called on
- * app modules
+ * One can register demo content as a separate module or as a set of callbacks
+ * hook_apps_app_info is a hook that will only be called on app modules
  *
- * RETURN: and associtive array
+ * @return array
  */
 function hook_apps_app_info() {
   return array(
     //Demo Content
     'demo content description' => 'This tells what add demo content will do it is placed on the configure form',
-    //The perfered way for an app to provide demo content is to have a module 
+    //The preferred way for an app to provide demo content is to have a module 
     //that when enabled will add demo content, and when disabled will removed 
     //demo content
     //this module should be a submodule or part of the manifest dependent modules
     'demo content module' => 'appname_demo_content',
 
-    //If the demo content is provide in a differnt way one should provide the
+    //If the demo content is provided in a different way one should provide the
     //following callbacks
     'demo content enabled' => 'appname_demo_content_enabled', //should return True if demo content is on
     'demo content enable' => 'appname_demo_content_enable', //should turn on demo content and return true
     'demo content disable' => 'appname_demo_content_disable', //should turn off demo content and return true
 
     'configure form' => 'appname_app_configure_form', // This form will be render on the app config page
-    'post install callback' => 'appname_app_post_install', // This will be called after the app is enabled intialy or of the app has been uninstalled
+    'post install callback' => 'appname_app_post_install', // This will be called after the app is enabled initially or when the app has been uninstalled
     'status callback' => 'appname_app_status'
+  );
     /*
-    This call back is used to render a status table on the config page.  it should be an array with two keys (and on optional third) 
+    This callback is used to render a status table on the config page. It should be an array with two keys (and on optional third) 
     array(
       'title' =>'Status'  //title of the table,
       'items' => array(  //rows in the table with any keys
         array(
           'severity' =>    REQUIREMENT_WARNING, //REQUIREMENT_OK REQUIREMENT_INFO, REQUIREMENT_ERROR
           'title' => 'Example',
-          'description' => t("Instrunctions for Example"),
+          'description' => t("Instructions for Example"),
           'action' => array(l("Link to do something!", "")),
         ),
       ),
       // headers are optional but these are the default
       'headers' => array('severity', 'title', 'description', 'action')
     );
-    serverity and 
     */
 }
 
 
 /**
- * provides server information to the apps
+ * Provides server information to the apps
+ *
+ * This hook is only called on the current profile
  *
- * this hook is only called on the current profile
- * RETURN: an array of assoctive server arrays
+ * @return array
+ * An array of associative server arrays
  */
 function hook_apps_servers_info() {
   return array(
     'servername' => array(
-      'title' => t('Store Title'), //the title to be use for the server
+      'title' => t('Store Title'), //the title to be used for the server
       'description' => t('A description of the server and what apps it might have'),
-      'manifest' => 'http://apps.com/app/query', // the location of the  json manifest
+      'manifest' => 'http://apps.com/app/query', // the location of the json manifest
     ),
   );
 }
 
 /**
  * Add an apps install step to an installation profile.
- * 
+ *
  * Use this in your hook_install_tasks to add all the needed tasks for installing
  * apps. Set the App Server key and any default selected apps.
+ *
+ * @param $install_state array
+ * @TODO: Add array description
+ *
+ * @return array
  */
 function hook_install_tasks($install_state) {
   $tasks = array();
   require_once(drupal_get_path('module', 'apps') . '/apps.profile.inc');
   $server = array(
-    'title' => 'App Server Name'
+    'title' => 'App Server Name',
     'machine name' => 'apps_server_machine_name',
     'default apps' => array(
       'app_machine_name_1',
@@ -134,7 +143,7 @@ $js = <<<JS
       // keys used in the downloadables hash later in the manifest.
       "libraries": {
         "jquery_ideation": "jquery_ideation 1.0"
-      }
+      },
       // A hash of resources to be downloaded. The key is used else where in the manifest. The value
       // should be a url to a publicly downloadable archive (tar gz zip)
       "downloadables": {
diff --git a/apps.manifest.inc b/apps.manifest.inc
index c2c54db..255ed9f 100755
--- a/apps.manifest.inc
+++ b/apps.manifest.inc
@@ -8,16 +8,16 @@
 function apps_server_local($server) {
   $apps = array();
   $infos = system_rebuild_module_data();
-  foreach($infos as $module => $info) {
-    if(isset($info->info['apps']['server'])) {
-      if($info->info['apps']['server'] = $server['name']) {
-        foreach($info->info['apps']['manifests'] as $mfile) {
-          $mfile = drupal_get_path("module", $module) . "/" .$mfile;
+  foreach ($infos as $module => $info) {
+    if (isset($info->info['apps']['server'])) {
+      if ($info->info['apps']['server'] = $server['name']) {
+        foreach ($info->info['apps']['manifests'] as $mfile) {
+          $mfile = drupal_get_path("module", $module) . "/" . $mfile;
           $app = drupal_parse_info_file($mfile);
-          foreach($app['screenshots'] as $id=>$image) {
+          foreach ($app['screenshots'] as $id => $image) {
             $app['screenshots'][$id] = url(dirname($mfile) . "/" . $image);
           }
-            $app['logo'] = url(dirname($mfile) . "/" . $app['logo']);
+          $app['logo'] = url(dirname($mfile) . "/" . $app['logo']);
           $apps[] = $app;
         }
       }
@@ -25,12 +25,15 @@ function apps_server_local($server) {
   }
   return $apps;
 }
-/*
- * returns all servers/server defined by the current profile
- * PARAM server_name: the  name of a server
- * RETURN : an array of server arrays one server array if $server_name has a value
+
+/**
+ * Returns all servers/server defined by the current profile
+ * @param $server_name boolean
+ *     The name of a server
+ * @return array
+ *     Array contains server arrays or one server array if $server_name has a value
  *
- * TODO: Turn Store Objects in to Object instead of arrays OPIC-372
+ * @TODO: Turn Store Objects in to Object instead of arrays OPIC-372
  */
 function apps_servers($server_name = FALSE) {
   $servers_cache = cache_get('apps_servers');
@@ -44,7 +47,7 @@ function apps_servers($server_name = FALSE) {
 
     drupal_alter('apps_servers', $servers);
 
-    foreach($servers as $name =>$server) {
+    foreach ($servers as $name => $server) {
       $servers[$name]['name'] = $name;
     }
   }
@@ -59,8 +62,8 @@ function apps_servers($server_name = FALSE) {
     );
   }
   cache_set('apps_servers', $servers);
-  if($server_name) {
-    if(isset($servers[$server_name])) {
+  if ($server_name) {
+    if (isset($servers[$server_name])) {
       return $servers[$server_name];
     }
   }
@@ -69,25 +72,31 @@ function apps_servers($server_name = FALSE) {
   }
   return FALSE;
 }
+
 /**
- * retrieve apps from the manifest 
- * PARAM $server: a server object return from apps_servers
- * PARAM $condition: and array of key and values to match in the app arrays
- * PARAM $add_theme: if True apps_apps_add_theme will be called when done getting apps
- * RETURN : an array of app info arrays
+ * Retrieves apps from the manifest
+ * @param $server
+ *        Server object return from apps_servers
+ * @param array $condition
+ *        Array of key and values to match in the app arrays
+ * @param bool $add_theme
+ *        If True apps_apps_add_theme will be called when done getting apps
+ *
+ * @return an array of app info arrays
+ * @throws Exception
  */
-function apps_apps($server, $condition = array(), $add_theme=FALSE) { 
+function apps_apps($server, $condition = array(), $add_theme = FALSE) {
   if (!is_array($server)) {
     $server = apps_servers($server);
   }
   $manifest = apps_manifest($server);
   if (isset($manifest['error'])) {
-    $e= new Exception($manifest['error']);
+    $e = new Exception($manifest['error']);
     $e->request = $manifest['request'];
     throw $e;
   }
   $apps = $manifest['apps'];
-  foreach($apps as $id => $app) {
+  foreach ($apps as $id => $app) {
     $intersect = array_intersect_assoc($app, $condition);
     if ($intersect !== $condition) {
       unset($apps[$id]);
@@ -100,25 +109,27 @@ function apps_apps($server, $condition = array(), $add_theme=FALSE) {
 }
 
 /**
- * takes an array of apps and ands #theme properties so that
- * it can be drupal rendered
- * PARAM $apps: an array of apps from apps_apps
- * RETURN : the apps array with add #theme settings for a list 
- * view of the apps
+ * Changes the apps array by reference: adds #theme properties for a list view of the apps
+ * @param $apps array
+ *        array of apps from apps_apps
+ *
  */
 function apps_apps_add_theme(&$apps) {
-  foreach($apps as $id=> $app) {
+  foreach ($apps as $id => $app) {
     // add teaser theme
     $apps[$id]['#theme'] = 'apps_app_teaser';
     // add style name for image_style theming
-    if($apps[$id]['logo']) {
-      $apps[$id]['logo']['style_name']= 'apps_logo';
+    if ($apps[$id]['logo']) {
+      $apps[$id]['logo']['style_name'] = 'apps_logo';
     }
   }
   $apps['#theme'] = 'apps_list';
 }
 
-
+/**
+ * @TODO: Add function description
+ * @return null|string
+ */
 function apps_client_id() {
   $id = variable_get('apps_client_id', FALSE);
   if (!$id) {
@@ -126,130 +137,136 @@ function apps_client_id() {
     variable_set('apps_client_id', $id);
   }
   return $id;
-  
+
 }
 
 /**
  * Request manifest and media assets from the app server
- * PARAM $server: a server object return from apps_servers
- * RETURN : an array represntation of the json manifest, with images
- * relpaced by file objects
  *
- * TODO: Handle lack of server presense OPIC-374
+ * @param $server a server object return from apps_servers
+ *
+ * @return array representation of the json manifest, with images relpaced by file objects
+ *
+ * @TODO: Handle lack of server presense OPIC-374
  */
 function apps_request_manifest($server) {
   if ($cache = cache_get("apps_manifest_{$server['name']}")) {
     return $cache->data;
   }
 
-  if(!$server['manifest']) {
-     $apps = apps_server_local($server);
-     $manifest = $server;
-     $manifest['apps'] = $apps;
-     apps_request_manifest_image_process($manifest);
-     return $manifest;
+  if (!$server['manifest']) {
+    $apps = apps_server_local($server);
+    $manifest = $server;
+    $manifest['apps'] = $apps;
+    apps_request_manifest_image_process($manifest);
+    return $manifest;
   }
-  $info =  drupal_parse_info_file(dirname(__file__) . '/apps.info');
+  $info = drupal_parse_info_file(dirname(__file__) . '/apps.info');
   $rest_data = array(
     'client_id' => apps_client_id(),
     'apps_version' => $info['version'],
     'format' => 'json',
   ) + $server;
-  //I would like to do a post request but it is not happening
-  //$request = drupal_http_request($server['manifest'], array('method' => 'POST', 'data' => drupal_http_build_query($rest_data)));
+  // I would like to do a post request but it is not happening
+  // $request = drupal_http_request($server['manifest'], array('method' => 'POST', 'data' => drupal_http_build_query($rest_data)));
   $request = drupal_http_request($server['manifest'] . "?" . drupal_http_build_query($rest_data));
 
   if (isset($request->error)) {
     $manifest = array(
-      'error' =>"Manifest: {$server['manifest']} {$request->error}",
+      'error' => "Manifest: {$server['manifest']} {$request->error}",
       'request' => $request,
       'apps' => array(),
     );
   }
-  else if ($manifest = json_decode($request->data, TRUE)) {
-    // add any local apps
-    //$manifest['apps'] = $manifest['apps'] + $apps;
-    apps_request_manifest_image_process($manifest);
-    cache_set("apps_manifest_{$server['name']}", $manifest, 'cache', REQUEST_TIME + 60 +30);
-  }
   else {
-    $manifest = array(
-      'error' =>"Manifest: {$server['manifest']} json not parsable",
-      'request' => $request,
-      'apps' => array(),
-    );
+    if ($manifest = json_decode($request->data, TRUE)) {
+      // Add any local apps
+      //$manifest['apps'] = $manifest['apps'] + $apps;
+      apps_request_manifest_image_process($manifest);
+      cache_set("apps_manifest_{$server['name']}", $manifest, 'cache', REQUEST_TIME + 60 + 30);
+    }
+    else {
+      $manifest = array(
+        'error' => "Manifest: {$server['manifest']} json not parsable",
+        'request' => $request,
+        'apps' => array(),
+      );
+    }
   }
 
   return $manifest;
 }
 
-/*
+/**
  * Downloads images so that they can be sized with image styles
+ *
+ * @param $manifest @TODO: Add parameter description
  */
 function apps_request_manifest_image_process(&$manifest) {
-  foreach($manifest['apps'] as $id => $app) {
-    //Get Logo
-    $logo_uri = $app['logo'];
+  foreach ($manifest['apps'] as $id => $app) {
+    // Get Logo
     $logo = (array) apps_retrieve_app_image($app['logo'], "{$app['name']} Logo");
 
     $manifest['apps'][$id]['logo'] = !empty($logo) ? $logo : FALSE;
 
-    //Get screenshots
+    // Get screenshots
     foreach ($app['screenshots'] as $ss_id => $ss) {
-      $screenshot =  (array) apps_retrieve_app_image($ss, "{$app['name']} Screenshot $id");
-      
-      if(!empty($screenshot)) {
-        $manifest['apps'][$id]['screenshots'][$ss_id] = $screenshot; 
+      $screenshot = (array) apps_retrieve_app_image($ss, "{$app['name']} Screenshot $id");
+
+      if (!empty($screenshot)) {
+        $manifest['apps'][$id]['screenshots'][$ss_id] = $screenshot;
       }
       else {
-        unset($manifest['apps'][$id]['screenshots'][$ss_id]); 
+        unset($manifest['apps'][$id]['screenshots'][$ss_id]);
       }
     }
   }
-
 }
 
 /**
- * Download a image from the manifest 
+ *  Download a image from the manifest
  *
- * PARAM url: the url of the image
- * PARAM title: the title of the image
- * PARAM alt: the alt text of the image
- * RETURN : a file object for the download file or FALSE if no image was downloaded
+ * @param $url
+ *             the url of the image
+ * @param bool $title
+ *             the title of the image
+ * @param bool $alt
+ *             the alt text of the image
  *
+ * @return bool|mixed|stdClass
+ *             a file object for the download file or FALSE if no image was downloaded
  */
 function apps_retrieve_app_image($url, $title = FALSE, $alt = FALSE) {
-  //allow for local files from the development server type
+  // Allow for local files from the development server type
   $check = parse_url($url);
-  if(!$check || !isset($check['host']) || !$check['host']){
-    $url = url($url, array('absolute'=>TRUE));
+  if (!$check || !isset($check['host']) || !$check['host']) {
+    $url = url($url, array('absolute' => TRUE));
   }
-  
-  //to prevent strict warning need to store this in a variable
+
+  // To prevent strict warning need to store this in a variable
   $url_parts = explode("/", parse_url($url, PHP_URL_PATH));
-  
+
   $file_name = array_pop($url_parts);
-  
+
   $uri = file_build_uri("apps/$file_name");
   $current = FALSE;
-  
+
   $fids = db_select('file_managed', 'f')
     ->condition('uri', $uri)
     ->fields('f', array('fid'))
     ->execute()
     ->fetchCol();
-  
+
   if (!empty($fids) && isset($fids[0]) && is_numeric($fids[0])) {
     $current = file_load($fids[0]);
   }
-   //check to see if the remote file is newer than the one that we have and that the one we have
-   // still exists
-  if($current && file_exists($current->uri)){
+  // Check to see if the remote file is newer than the one that we have and that the one we have still exists
+  if ($current && file_exists($current->uri)) {
     $remote = drupal_http_request($url, array('method' => 'HEAD')); //get the remote headers
     $remote = $remote->headers;
     $remote_timestamp = strtotime($remote['last-modified']);
 
-    if($remote_timestamp <= $current->timestamp && !empty($remote['content-length']) && $remote['content-length'] == $current->filesize){
+    if ($remote_timestamp <= $current->timestamp && !empty($remote['content-length']) && $remote['content-length'] == $current->filesize) {
       //TODO make this a file 
       $current->path = $current->uri;
       $current->title = $title ? $title : '';
@@ -257,7 +274,7 @@ function apps_retrieve_app_image($url, $title = FALSE, $alt = FALSE) {
       return $current;
     }
   }
-   
+
   $request = drupal_http_request($url, array(), 'GET');
 
   if (isset($request->data)) {
@@ -282,13 +299,15 @@ function apps_retrieve_app_image($url, $title = FALSE, $alt = FALSE) {
  * Starting with the json manifest and adding data around the current status of the app
  * in this install
  *
- * PARAM $server: a server object return from apps_servers
- * RETURN : an array of the process json manifest
+ * @param $server stdClass
+ *        object server object returned from apps_servers
  *
- *TODO: Cache status data and clear on changes to any module status
+ * @return array
+ *         an array of the process json manifest
+ * @TODO: Cache status data and clear on changes to any module status
  */
 function apps_manifest($server) {
-  $manifests = &drupal_static(__FUNCTION__);
+  $manifests = & drupal_static(__FUNCTION__);
   require_once DRUPAL_ROOT . '/includes/install.inc';
   if (empty($manifests[$server['name']]) && !isset($manifests[$server['name']]['error'])) {
     // Get manifest from server
@@ -299,7 +318,7 @@ function apps_manifest($server) {
     }
     $modules = system_rebuild_module_data();
     $apps = array();
-    foreach($manifest['apps'] as $app) {
+    foreach ($manifest['apps'] as $app) {
       $current_app_module = isset($modules[$app['machine_name']]) ? $modules[$app['machine_name']] : FALSE;
       $app['enabled'] = $current_app_module && $current_app_module->status;
       $app['incompatable'] = FALSE;
@@ -311,7 +330,7 @@ function apps_manifest($server) {
       $app['dependencies'] = isset($app['dependencies']) ? $app['dependencies'] : array();
       $app['libraries'] = isset($app['libraries']) ? $app['libraries'] : array();
       // Add info to dependencies
-      foreach($app['dependencies'] as $name_version => $downloadable) {
+      foreach ($app['dependencies'] as $name_version => $downloadable) {
         //Parse dep versions
         $version = drupal_parse_dependency($name_version);
         $name = $version['name'];
@@ -323,11 +342,11 @@ function apps_manifest($server) {
         $enabled = $current && $current->status;
         $status = $incompatable ? APPS_INCOMPATIBLE : (!$installed ? APPS_INSTALLABLE : ($enabled ? APPS_ENABLED : APPS_DISABLED));
 
-        if($status == APPS_INCOMPATIBLE) {
+        if ($status == APPS_INCOMPATIBLE) {
           //if any one module is incompatable then the app is incompatable
           $app['incompatable'] = TRUE;
         }
-        if($status == APPS_INSTALLABLE) {
+        if ($status == APPS_INSTALLABLE) {
           //if any one module is installable then we are not installed yet
           $app['dep_installed'] = FALSE;
         }
@@ -346,23 +365,23 @@ function apps_manifest($server) {
       if (isset($app['libraries'])) {
         $profile = variable_get('install_profile', 'standard');
         $profile_path = drupal_get_path('profile', $profile);
-        foreach($app['libraries'] as $name_version => $downloadable) {
+        foreach ($app['libraries'] as $name_version => $downloadable) {
           $info = array(
             'downloadable' => $downloadable,
-            'version' => array('name'=>$name_version),
+            'version' => array('name' => $name_version),
             'status' => APPS_INSTALLABLE,
             'incompatable' => 0,
             'enabled' => 0,
-            'installed' =>  is_dir(DRUPAL_ROOT . "/sites/all/libraries/$name_version") || is_dir($profile_path . "/libraries/$name_version"),
+            'installed' => is_dir(DRUPAL_ROOT . "/sites/all/libraries/$name_version") || is_dir($profile_path . "/libraries/$name_version"),
           );
           $app['libraries'][$name_version] = $info;
         }
       }
       $app['status'] = $app['incompatable'] ? APPS_INCOMPATIBLE : (!$app['installed'] || !$app['dep_installed'] ? APPS_INSTALLABLE : ($app['enabled'] ? APPS_ENABLED : APPS_DISABLED));
       $apps[$app['machine_name']] = $app;
-      
+
     }
-    //overide json apps with our inhanced apps
+    // Override json apps with our inhanced apps
     apps_add_app_info($apps);
     $manifest['apps'] = $apps;
     $manifests[$server['name']] = $manifest;
@@ -370,6 +389,10 @@ function apps_manifest($server) {
   return $manifests[$server['name']];
 }
 
+/**
+ * @TODO: Add function description
+ * @param $apps
+ */
 function apps_add_app_info(&$apps) {
   $info_cache = cache_get("apps_installed_app_info");
   $info = array();
@@ -377,20 +400,20 @@ function apps_add_app_info(&$apps) {
     $info = $info_cache->data();
   }
   $set_cache = FALSE;
-  foreach($apps as $id => $app) {
-    if(!isset($info[$app['machine_name']])) {
-       $info[$app['machine_name']] = ($i = module_invoke($app['machine_name'], 'apps_app_info')) ? $i : array();
-       $set_cache = TRUE;
+  foreach ($apps as $id => $app) {
+    if (!isset($info[$app['machine_name']])) {
+      $info[$app['machine_name']] = ($i = module_invoke($app['machine_name'], 'apps_app_info')) ? $i : array();
+      $set_cache = TRUE;
     }
     $apps[$id] += $info[$app['machine_name']];
-    //add defaults
+    // Add defaults
     $info_defaults = array(
       'configure form' => $app['machine_name'] . "_apps_app_configure_form",
       'demo content description' => "Enabling the demo content will add content to the site that can help to understand how the app functions.  When it is disabled all of the demo content will be removed.",
     );
     $apps[$id] += $info_defaults;
-    
-    // set demo content callbacks if demo content module is set
+
+    // Set demo content callbacks if demo content module is set
     if (isset($apps[$id]['demo content module'])) {
       $apps[$id] += array(
         'demo content enabled callback' => 'apps_demo_content_enabled',
@@ -404,32 +427,41 @@ function apps_add_app_info(&$apps) {
   }
 }
 
+/**
+ * @TODO: Add function description
+ * @param $app
+ * @param $key
+ * @return mixed
+ */
 function apps_app_callback($app, $key) {
   module_load_include("inc", $app['machine_name'], $app['machine_name'] . ".app");
-  if(isset($app['file'])) {
+  if (isset($app['file'])) {
     require_once $app['file'];
   }
-  if (isset($app[$key]) && module_exists($app['machine_name']) && function_exists($app[$key])){
+  if (isset($app[$key]) && module_exists($app['machine_name']) && function_exists($app[$key])) {
     return $app[$key];
   }
 }
 
 
 /**
- * default demo content enabled callback
- * 
- * check to see if the apps demo content module is enabled
+ *
+ * Checks if the apps demo content module is enabled
+ *
+ * @param $app array: an app array
+ *
+ * @return bool if the module was enabled
  */
 function apps_demo_content_enabled($app) {
   return (module_exists($app['demo content module']));
 }
 
 /**
- * default demo content enable callback
- * 
- * enables the app's demo content module
- * PARAM $app: an app array
- * RETURN : bool if the module was enabled
+ * Enables the app's demo content module
+ *
+ * @param $app array: an app array
+ *
+ * @return bool if the module was enabled
  */
 function apps_demo_content_enable($app) {
   $success = module_enable(array($app['demo content module']));
@@ -438,11 +470,11 @@ function apps_demo_content_enable($app) {
 }
 
 /**
- * default demo content disable callback
- * 
- * disables the app's demo content module
- * PARAM $app: an app array
- * RETURN : bool if the module was disabled
+ * Disables the app's demo content module
+ *
+ * @param $app array: an app array
+ *
+ * @return bool if the module was disabled
  */
 function apps_demo_content_disable($app) {
   $success = module_disable(array($app['demo content module']));
@@ -451,7 +483,14 @@ function apps_demo_content_disable($app) {
 }
 
 /**
- * formcall back for demo content
+ *
+ * Form callback for demo content
+ *
+ * @param $form
+ * @param $form_state
+ * @param $app
+ *
+ * @return array
  */
 function apps_demo_content_form($form, &$form_state, $app) {
   $form = array();
@@ -462,7 +501,7 @@ function apps_demo_content_form($form, &$form_state, $app) {
     '#title' => "Demo Content for {$app['name']}",
   );
   $form['demo_content_group']['demo_content_current'] = array(
-    '#markup' => $app['demo content description']. " <i>Demo content for {$app['name']} is currently " . ($enabled ? 'enabled' : 'disabled') . ".</i><br /><br />",
+    '#markup' => $app['demo content description'] . " <i>Demo content for {$app['name']} is currently " . ($enabled ? 'enabled' : 'disabled') . ".</i><br /><br />",
   );
   $form['demo_content_action'] = array(
     '#type' => 'value',
@@ -485,24 +524,27 @@ function apps_demo_content_form($form, &$form_state, $app) {
 }
 
 /**
- * callback for demp content form
+ * Callback for demo content form
+ *
+ * @param $form
+ * @param $form_state
  */
 function apps_demo_content_form_submit($form, &$form_state) {
   $app = $form_state['values']['app'];
   $enable = $form_state['values']['demo_content_action'];
-  if($enable) {
-     $cb = apps_app_callback($app, 'demo content enable callback'); 
-     $success = $cb($app);
-     if($success) {
-       drupal_set_message("Enabled demo content for {$app['name']}");
-     }
+  if ($enable) {
+    $cb = apps_app_callback($app, 'demo content enable callback');
+    $success = $cb($app);
+    if ($success) {
+      drupal_set_message("Enabled demo content for {$app['name']}");
+    }
   }
   else {
-     $cb = apps_app_callback($app, 'demo content disable callback'); 
-     $success = $cb($app);
-     if($success) {
-       drupal_set_message("Disabled demo content for {$app['name']}");
-     }
+    $cb = apps_app_callback($app, 'demo content disable callback');
+    $success = $cb($app);
+    if ($success) {
+      drupal_set_message("Disabled demo content for {$app['name']}");
+    }
   }
 }
 
diff --git a/apps.pages.inc b/apps.pages.inc
index af8ce49..f546111 100755
--- a/apps.pages.inc
+++ b/apps.pages.inc
@@ -41,25 +41,24 @@ function apps_market_page() {
  * Callback list off all apps
  */
 function apps_install_page($server_name) {
-  apps_include('manifest'); 
+  apps_include('manifest');
   $element = array(
-    '#theme'=> 'apps_install_page',
+    '#theme' => 'apps_install_page',
   );
   //find all apps
   try {
     $apps = apps_apps($server_name, array(), TRUE);
     if (!empty($apps)) {
       $element['apps'] = $apps;
-      $featured_apps = apps_apps($server_name , array('featured' => TRUE)) ;
-      if(!empty($featured_apps)) {
+      $featured_apps = apps_apps($server_name, array('featured' => TRUE));
+      if (!empty($featured_apps)) {
         $element['featured_app'] = array_pop($featured_apps);
       }
     }
-  }
-  catch (Exception $e) {
+  } catch (Exception $e) {
     drupal_set_message(t("There was the following error: @msg", array('@msg' => $e->getMessage())), 'warning');
   }
-  return $element; 
+  return $element;
 }
 
 /**
@@ -68,14 +67,13 @@ function apps_install_page($server_name) {
 function apps_manage_page($server) {
   apps_include('manifest');
   $element = array(
-    '#theme'=> 'apps_manage_page',
+    '#theme' => 'apps_manage_page',
   );
   // find all installed apps
   try {
-    $apps = apps_apps($server['name'], array("installed" =>TRUE), TRUE);
+    $apps = apps_apps($server['name'], array("installed" => TRUE), TRUE);
     $element['apps'] = $apps;
-  }
-  catch (Exception $e) {
+  } catch (Exception $e) {
     drupal_set_message("There was the following error - " . $e->getMessage(), 'warning');
   }
   return $element;
@@ -86,7 +84,7 @@ function apps_manage_page($server) {
  */
 function apps_update_page($server) {
   return array(
-    '#theme'=> 'apps_update_page',
+    '#theme' => 'apps_update_page',
   );
 }
 
@@ -96,12 +94,12 @@ function apps_update_page($server) {
 function apps_app_config_page($app) {
   apps_include('manifest');
   $element = array();
-  if(apps_app_callback($app, "demo content enable callback")) {
+  if (apps_app_callback($app, "demo content enable callback")) {
     $element['demo'] = drupal_get_form('apps_demo_content_form', $app);
   }
 
   // Check for a status table
-  if($data_callback = apps_app_callback($app, "status callback")) {
+  if ($data_callback = apps_app_callback($app, "status callback")) {
     $data = $data_callback();
     $header = isset($data['header']) ? $data['header'] : NULL;
     $items = isset($data['items']) ? $data['items'] : array();
@@ -111,8 +109,8 @@ function apps_app_config_page($app) {
       'table' => apps_app_status_report($items, $header),
     );
   }
-  if($form = apps_app_callback($app, "configure form")) {
-    $element['config'] =  drupal_get_form($form);
+  if ($form = apps_app_callback($app, "configure form")) {
+    $element['config'] = drupal_get_form($form);
   }
   return $element;
 }
@@ -179,7 +177,7 @@ function apps_app_enable($app) {
     if (!$app['disabled'] && ($cb = apps_app_callback($app, "post install callback"))) {
       $cb($app);
     }
-    if(!apps_app_access('administer apps', $app, 'configure')) {
+    if (!apps_app_access('administer apps', $app, 'configure')) {
       $next = apps_app_page_path($app);
     }
   }
@@ -196,7 +194,8 @@ function apps_app_enable($app) {
 function apps_app_disable($app) {
   // Force the user to disable demo content before disabling the app
   if (($is_cb = apps_app_callback($app, "demo content enabled callback")) &&
-    $is_cb($app)) {
+    $is_cb($app)
+  ) {
     $next = apps_app_page_path($app, 'configure');
     drupal_set_message(t("Please disable demo content before disabling the app"));
     drupal_goto($next);
@@ -225,7 +224,7 @@ function apps_app_uninstall($app) {
   }
   else {
     drupal_set_message(t("Uninstalling @name app failed. Please ensure all modules that depend on this module are also uninstalled", array('@name' => $app['name'])));
-   }
+  }
   $next = apps_app_page_path($app);
   drupal_goto($next);
 }
@@ -239,7 +238,7 @@ function apps_settings_form() {
     '#title' => t('Enable Development Console'),
     '#description' => t('Allows local Apps to be displayed in a development app server.'),
     '#type' => 'checkbox',
-    '#default_value'=> variable_get('apps_enable_dev_console', FALSE),
+    '#default_value' => variable_get('apps_enable_dev_console', FALSE),
   );
   $form['apps_allow_voting'] = array(
     '#title' => t('Allow Voting'),
@@ -264,7 +263,7 @@ function apps_settings_form_submit() {
 /**
  * apps_app_status_report()
  *
- * @PARAM items: an array of items to display the keys of which should be the 
+ * @PARAM items: an array of items to display the keys of which should be the
  * keys of the $header param or use the default.
  * The default are severity, title, description and action.  Severity is expected to be
  * an int in (REQUIREMENT_INFO, REQUIREMENT_OK, REQUIREMENT_WARNING, REQUIREMENT_ERROR)
@@ -274,7 +273,7 @@ function apps_settings_form_submit() {
  * @RETURN: a render array for the status report table
  */
 function apps_app_status_report($items, $header = NULL) {
-  if(!isset($header)) {
+  if (!isset($header)) {
     $header = array(
       'severity' => 'Status',
       'title' => 'Title',
@@ -287,42 +286,42 @@ function apps_app_status_report($items, $header = NULL) {
     REQUIREMENT_INFO => array(
       'title' => t('Info'),
       'class' => 'info',
-      'image' => array('#theme'=>"image", "#path" => "misc/message-24-info.png", "#alt"=>"Info"),
+      'image' => array('#theme' => "image", "#path" => "misc/message-24-info.png", "#alt" => "Info"),
     ),
     REQUIREMENT_OK => array(
       'title' => t('OK'),
       'class' => 'ok',
-      'image' => array('#theme'=>"image", "#path" => "misc/message-24-ok.png", "#alt"=>"Ok"),
+      'image' => array('#theme' => "image", "#path" => "misc/message-24-ok.png", "#alt" => "Ok"),
     ),
     REQUIREMENT_WARNING => array(
       'title' => t('Warning'),
       'class' => 'warning',
-      'image' => array('#theme'=>"image", "#path" => "misc/message-24-warning.png", "#alt"=>"Warning"),
+      'image' => array('#theme' => "image", "#path" => "misc/message-24-warning.png", "#alt" => "Warning"),
     ),
     REQUIREMENT_ERROR => array(
       'title' => t('Error'),
       'class' => 'error',
-      'image' => array('#theme'=>"image", "#path" => "misc/message-24-error.png", "#alt"=>"Error"),
+      'image' => array('#theme' => "image", "#path" => "misc/message-24-error.png", "#alt" => "Error"),
     ),
   );
-  foreach($items as $item) {
+  foreach ($items as $item) {
     $row = array();
-    foreach(array_keys($header) as $key) {
-      if(isset($item[$key])) {
-        if($key =='severity') {
+    foreach (array_keys($header) as $key) {
+      if (isset($item[$key])) {
+        if ($key == 'severity') {
           $row['data'][] = render($severities[$item[$key]]['image']);
           $row['class'][] = $severities[$item[$key]]['class'];
         }
-        elseif($key == 'action') {
+        elseif ($key == 'action') {
           $row['data'][] = theme('item_list', array("items" => $item[$key]));
-        
+
         }
         else {
           $row['data'][] = $item[$key];
         }
       }
       else {
-          $row['data'][] = '';
+        $row['data'][] = '';
       }
     }
     $rows[] = $row;
diff --git a/apps.profile.inc b/apps.profile.inc
index 523af75..52e78b5 100644
--- a/apps.profile.inc
+++ b/apps.profile.inc
@@ -1,12 +1,12 @@
 <?php
 /**
- * This file handles all the functions for downloading, transferring and 
+ * @file This file handles all the functions for downloading, transferring and
  * installing apps during the install process.
  */
 
 /**
  * Add install tasks to profile install tasks.
- * 
+ *
  * See apps.api.php for use.
  *
  */
@@ -77,8 +77,7 @@ function apps_profile_apps_select_form($form, $form_state, &$install_state) {
 
     $_SESSION['apps_server'] = $apps_server;
     $_SESSION['apps_manifest'] = apps_apps($apps_server['machine name']);
-  }
-  catch (Exception $e) {
+  } catch (Exception $e) {
     $form['info'] = array(
       '#markup' => t('<h2>Error</h2><p>Unable to connect to Apps Server.</p><p>Click "Continue" to finish the installation. You can either fix your internet connection and try the installation again or install apps later from the apps config page.</p>'),
     );
@@ -96,7 +95,7 @@ function apps_profile_apps_select_form($form, $form_state, &$install_state) {
   else {
     drupal_set_title(apps_profile_get_server_name($_SESSION['apps_server']));
     $form['actions'] = array('#type' => 'actions', '#weight' => 3);
-    foreach($_SESSION['apps_manifest'] as $name => $app) {
+    foreach ($_SESSION['apps_manifest'] as $name => $app) {
       if ($name != '#theme') {
         $options[$name] = '<strong>' . $app['name'] . '</strong>';
         if (isset($app['description'])) {
@@ -116,7 +115,7 @@ function apps_profile_apps_select_form($form, $form_state, &$install_state) {
       '#collapsible' => FALSE,
     );
     $form['apps_fieldset']['apps'] = array(
-      '#type' =>'checkboxes',
+      '#type' => 'checkboxes',
       '#title' => t('Apps'),
       '#default_value' => $_SESSION['apps_server']['default apps'],
       '#options' => $options,
@@ -160,7 +159,7 @@ function apps_profile_apps_select_form_submit($form, &$form_state) {
     // Determine if any apps need to be downloaded.
     apps_include('manifest');
     $installed_apps = apps_apps($_SESSION['apps_server']['machine name'], array('installed' => TRUE), TRUE);
-    $_SESSION['apps_downloads'] = array_diff_key($_SESSION['apps'], $installed_apps) ? TRUE: FALSE;
+    $_SESSION['apps_downloads'] = array_diff_key($_SESSION['apps'], $installed_apps) ? TRUE : FALSE;
     $_SESSION['apps_default_content'] = $form_state['values']['default_content'];
   }
 }
@@ -175,7 +174,7 @@ function apps_profile_download_app_modules(&$install_state) {
     $apps[] = $_SESSION['apps_manifest'][$name];
   }
   $batch = apps_download_apps_batch($apps);
-  
+
   $batch['finished'] = 'apps_profile_download_batch_finished';
   return $batch;
 }
@@ -221,8 +220,8 @@ function apps_profile_authorize_transfer($form, $form_state, &$install_state) {
 }
 
 /**
- * Callback after the authorize_filetransfer_form_submit. 
- * 
+ * Callback after the authorize_filetransfer_form_submit.
+ *
  * Save the file transfer protocol.
  */
 function apps_profile_authorize_transfer_save($filetransfer, $nothing = array()) {
@@ -236,13 +235,13 @@ function apps_profile_install_app_modules(&$install_state) {
   $batch = array();
   if (!empty($_SESSION['update_manager_update_projects'])) {
     apps_include('installer');
-    
+
     // Make sure the Updater registry is loaded.
     drupal_get_updaters();
 
     $updates = array();
     $project_types = $_SESSION['update_manager_update_projects'];
-    foreach($project_types as $type => $projects) {
+    foreach ($project_types as $type => $projects) {
       $directory = apps_extract_directory($type);
       foreach ($projects as $project => $url) {
         $project_location = $directory . '/' . $project;
@@ -255,7 +254,7 @@ function apps_profile_install_app_modules(&$install_state) {
         );
       }
     }
-    
+
     if (isset($_SESSION['filetransfer'])) {
       // We have authenticated a filetransfer so use it.
       $filetransfer = $_SESSION['filetransfer'];
@@ -319,7 +318,7 @@ function apps_profile_enable_app_modules(&$install_state) {
     }
   }
   // Do dependency checking so everything doesn't break from one missing dependency.
-  foreach($modules as $id => $module) {
+  foreach ($modules as $id => $module) {
     if (!apps_profile_check_dependencies(array($module => $module))) {
       // Something went wrong. Remove from queue and add error.
       unset($modules[$id]);
@@ -331,7 +330,7 @@ function apps_profile_enable_app_modules(&$install_state) {
   if (!empty($modules)) {
     // Setup the batch comments
     $enable_commands = array();
-    foreach($modules as $module) {
+    foreach ($modules as $module) {
       $module_info = system_get_info('module', $module);
       $module_name = isset($module_info['name']) ? $module_info['name'] : $module;
       $enable_commands[] = array('app_profile_enable_module', array($module, $module_name));
@@ -349,6 +348,12 @@ function apps_profile_enable_app_modules(&$install_state) {
   }
 }
 
+/**
+ * @TODO: Add function description
+ * @param $module
+ * @param $module_name
+ * @param $context
+ */
 function app_profile_enable_module($module, $module_name, &$context) {
   // This is here to show the user that we are in the process of enabling
   $context['message'] = t('Enabled %module app', array('%module' => $module_name));
@@ -362,7 +367,7 @@ function app_profile_enable_module($module, $module_name, &$context) {
   $context['finished'] = TRUE;
 }
 
-/**  
+/**
  * Batch callback invoked when enable batch is completed.
  */
 function apps_profile_enable_app_modules_finished($success, $results) {
@@ -375,7 +380,7 @@ function apps_profile_enable_app_modules_finished($success, $results) {
     );
     drupal_set_message(theme('item_list', $error_list), 'error');
   }
-  elseif(!$success) {
+  elseif (!$success) {
     // Ideally we're catching all Exceptions, so they should never see this,
     // but just in case, we have to tell them something.
     drupal_set_message(t('Fatal error trying to enable apps.'), 'error');
@@ -395,7 +400,7 @@ function apps_profile_enable_app_modules_finished($success, $results) {
 /**
  * Function to check and make sure all dependencies are available. This will stop stray apps
  * or broken downloads from stopping the install process for everything.
- * 
+ *
  * Copied from module_enable() in module.inc
  */
 function apps_profile_check_dependencies($module_list) {
@@ -424,7 +429,7 @@ function apps_profile_check_dependencies($module_list) {
       }
     }
   }
-  
+
   // If we make it this far then everything is good.
   return TRUE;
 }
@@ -535,7 +540,7 @@ function apps_install_verify_process($form) {
 function apps_profile_get_server_name($server) {
   $t = get_t();
   return isset($server['title'])
-             ? $t('Install @name Apps', array('@name' => $server['title']))
-             : $t('Install Apps');
+    ? $t('Install @name Apps', array('@name' => $server['title']))
+    : $t('Install Apps');
 
 }
diff --git a/apps.voting.inc b/apps.voting.inc
index bc68d30..421f3d3 100644
--- a/apps.voting.inc
+++ b/apps.voting.inc
@@ -1,17 +1,17 @@
 <?php
 define('APPS_VOTING_PATH', '/apps/vote/');
 /**
- *  @file
- *  Adds voting component for Apps.  Each client site will be able to submit one vote, 
+ * @file
+ *  Adds voting component for Apps.  Each client site will be able to submit one vote,
  *  which is tied to their site cliet id.  Has a corresponding file and component in the
  *  Appserver module.
  */
 
 /**
  *  Menu callback - this will be hit via an AJAX call to a menu hook
- *  @param $server is the machine name of the server
- *  @param $app is the machine name of the app
- *  @param $vote is a number between 0 and 100 representing the percentage vote
+ * @param $server is the machine name of the server
+ * @param $app is the machine name of the app
+ * @param $vote is a number between 0 and 100 representing the percentage vote
  */
 function apps_vote_for_app($server, $app, $vote) {
   apps_include('manifest');
@@ -28,7 +28,7 @@ function apps_vote_for_app($server, $app, $vote) {
     $port = isset($parts['port']) ? ':' . $parts['port'] : '';
     $url = $parts['scheme'] . '://' . $parts['host'] . $port;
     $url .= APPS_VOTING_PATH . $app . '/' . $vote;
-    
+
     $result = drupal_http_request($url, array(
       'data' => 'client_id=' . $id,
     ));
@@ -47,7 +47,7 @@ function apps_vote_for_app($server, $app, $vote) {
     else {
       $output = array('error' => 'Server connection failed, vote could not be saved.');
     }
-  } 
+  }
   else {
     $output = array('error' => 'Server URL failed to parse: ' . $url);
   }
@@ -62,18 +62,19 @@ function apps_vote_for_app($server, $app, $vote) {
 function apps_theme_voting_widget($vars) {
   if (!empty($vars['app']['rating'])) {
     $ratings = $vars['app']['rating'];
-  } else {
+  }
+  else {
     $ratings = array(
       'count' => 0,
       'average' => 100,
     );
   }
-  
-  $teaser = !empty($vars['app']['teaser']); 
-  
+
+  $teaser = !empty($vars['app']['teaser']);
+
   $server = $vars['app']['server']['name'];
   $mname = $vars['app']['machine_name'];
-  
+
   //retrieve the user's current rating or the defaults
   $app_ratings = variable_get('apps_user_ratings', array());
   $user_rating = isset($app_ratings[$server][$mname]) ? $app_ratings[$server][$mname] : FALSE;
@@ -84,23 +85,23 @@ function apps_theme_voting_widget($vars) {
     'apps' => array(
       $mname => array(
         'url' => '/apps/vote/' . $server . '/' . $mname . '/',
-        'rating' => array (
+        'rating' => array(
           'average' => $ratings['average'],
           'count' => $ratings['count'],
           'stars' => $stars,
           'user' => $user_rating,
-        ), 
+        ),
       ),
     ),
   );
   // check if there is a vote for this app already - otherwise hide the label until there is.
   $hasvote = ($user_rating === FALSE) ? 'no-vote' : '';
 
-  $render_arr = array (
+  $render_arr = array(
     '#prefix' => '<div class="app-rating clearfix" id="app-rating-' . $vars['app']['machine_name'] . '">',
     'rating' => array(
       '#prefix' => '<div class="app-stars-holder" title="' . $stars . '">',
-      '#markup' => '<span class="app-stars" style="width:'. $ratings['average'] . '%"></span>',
+      '#markup' => '<span class="app-stars" style="width:' . $ratings['average'] . '%"></span>',
       '#suffix' => '</div>'
     ),
     'numratings' => array(
