 
         return cache[typeName][objectData.id]
 
+    @load: (snapbill, filters, callback) ->
+        console.log snapbill
+        cached = snapbill.object_cache[@type][filters.id] if filters.id?
+        callback cached, null if cached?
+
+        snapbill.request "POST", "/v1/#{@type}/get", filters, (requestData, error) =>
+            if error?
+                callback null, error
+            else
+                callback @create_object snapbill, @, requestData
+
+
     @list: (snapbill, params, callback) ->
         snapbill.request "POST", "/v1/#{@type}/list", params, (requestData, error) =>
             if error?

        console.log "EPIC FAIL #{error}"

    request: (type, url, params, callback) ->
        params = Snapbill.encode_params params
        if typeof XMLHttpRequest != 'undefined'
            request = new XMLHttpRequest()
            request.onload = =>
                if request.readyState is 4
                    if 2 is Math.floor request.status / 100
                        callback JSON.parse request.responseText
                    else
                        error = "Request to #{url} failed with request code #{request.status}"

User.prototype.constructor = User
User.constructor = User

class Client extends SnapbillObject
    @type: 'client'

Client.prototype.constructor = Client
Client.constructor = Client


snapbill =
    User           :User
    Client         :Client
    Snapbill       :Snapbill
    SnapbillObject :SnapbillObject

if exports?
    exports = snapbill
