         return false
     }
 
-    // Only GET allowed
+    /**
+    GET a request to server that fetches json structures, like list of documents, list of folders.
+
+    :param: url       url to fetch data from
+    :param: success   block with json data that has to be inserted to database
+    :param: failure   failure block with error that should be sent to present a UIAlertcontroller with API error
+
+    :returns: a task to resume when the request should be started
+    */
     func urlSessionJSONTask(#url: String,  success: (Dictionary<String,AnyObject>) -> Void , failure: (error: APIError) -> ()) -> NSURLSessionTask {
         let fullURL = NSURL(string: url, relativeToURL: NSURL(string: __SERVER_URI__))
         var urlRequest = NSMutableURLRequest(URL: fullURL!, cachePolicy: .ReturnCacheDataElseLoad, timeoutInterval: 50)

        return task
    }

    func jsonDataTask(urlrequest: NSURLRequest, success: (Dictionary <String, AnyObject>) -> Void , failure: (error: APIError) -> () ) -> NSURLSessionTask {
        let task = session.dataTaskWithRequest(urlrequest, completionHandler: { (data, response, error) -> Void in
            dispatch_async(dispatch_get_main_queue(), {
                let httpURL = response as? NSHTTPURLResponse
                let string = NSString(data: data, encoding: NSASCIIStringEncoding)
                 if let actualError = error as NSError! {
                    let error = APIError(error: actualError)
                    error.responseText = string as String?
                    failure(error: error)
                } else {
                    var jsonError : NSError?
                    if let actualData = data as NSData? {
                        if actualData.length == 0 {
                            let code : Int = {
                                if httpURL == nil {
                                    return Constants.Error.Code.UnknownError.rawValue
                                } else {
                                    return httpURL!.statusCode
                                }
                            }()
                            failure(error:APIError(error: NSError(domain: Constants.Error.apiClientErrorDomain, code: code, userInfo: nil)))
                        } else if (response as! NSHTTPURLResponse).didFail()  {
                            let err = APIError(domain: Constants.Error.apiClientErrorDomain, code: httpURL!.statusCode, userInfo: nil)
                            failure(error:err)
                        } else {
                            let serializer = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments, error: &jsonError) as! Dictionary<String, AnyObject>
                            success(serializer)
                        }
                    } else {
                        success(Dictionary<String, AnyObject>())
                    }
                }
            })

        return task
    }

    private func isUnauthorized(urlResponse: NSHTTPURLResponse?) -> Bool {
        if let actualResponse = urlResponse as NSHTTPURLResponse! {
            if (actualResponse.statusCode == 403 || actualResponse.statusCode == 401) {
                return true
