diff --git a/rackspace/lb/v1/acl/requests.go b/rackspace/lb/v1/acl/requests.go
index e564307..206ec48 100644
--- a/rackspace/lb/v1/acl/requests.go
+++ b/rackspace/lb/v1/acl/requests.go
@@ -1 +1,101 @@
 package acl
+
+import (
+	"errors"
+	"fmt"
+
+	"github.com/racker/perigee"
+	"github.com/rackspace/gophercloud"
+	"github.com/rackspace/gophercloud/pagination"
+	"github.com/rackspace/gophercloud/rackspace/lb/v1"
+)
+
+// List is the operation responsible for returning a paginated collection of
+// network items that define a load balancer's access list.
+func List(client *gophercloud.ServiceClient, lbID int) pagination.Pager {
+	url := rootURL(client, lbID)
+
+	return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
+		return AccessListPage{pagination.SinglePageBase(r)}
+	})
+}
+
+// CreateOptsBuilder is the interface responsible for generating the JSON
+// for a Create operation.
+type CreateOptsBuilder interface {
+	ToAccessListCreateMap() (map[string]interface{}, error)
+}
+
+// CreateOpts is a slice of CreateOpt structs, that allow the user to create
+// multiple nodes in a single operation (one node per CreateOpt).
+type CreateOpts []CreateOpt
+
+// CreateOpt represents the options to create a single node.
+type CreateOpt struct {
+	// Required - the IP address or CIDR for item to add to access list.
+	Address string
+
+	// Required - the type of the node. Either ALLOW or DENY.
+	Type Type
+}
+
+// ToAccessListCreateMap converts a slice of options into a map that can be
+// used for the JSON.
+func (opts CreateOpts) ToAccessListCreateMap() (map[string]interface{}, error) {
+	type itemMap map[string]interface{}
+	items := []itemMap{}
+
+	for k, v := range opts {
+		if v.Address == "" {
+			return itemMap{}, fmt.Errorf("Address is a required attribute, none provided for %d CreateOpt element", k)
+		}
+		if v.Type != ALLOW && v.Type != DENY {
+			return itemMap{}, fmt.Errorf("Type must be ALLOW or DENY")
+		}
+
+		item := make(itemMap)
+		item["address"] = v.Address
+		item["type"] = v.Type
+
+		items = append(items, item)
+	}
+
+	return itemMap{"accessList": items}, nil
+}
+
+func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOptsBuilder) CreateResult {
+	var res CreateResult
+
+	reqBody, err := opts.ToAccessListCreateMap()
+	if err != nil {
+		res.Err = err
+		return res
+	}
+
+	_, res.Err = perigee.Request("POST", rootURL(client, loadBalancerID), perigee.Options{
+		MoreHeaders: client.AuthenticatedHeaders(),
+		ReqBody:     &reqBody,
+		OkCodes:     []int{202},
+	})
+
+	return res
+}
+
+func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, itemIDs []int) DeleteResult {
+	var res DeleteResult
+
+	if len(itemIDs) > 10 || len(itemIDs) == 0 {
+		res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 item IDs")
+		return res
+	}
+
+	url := rootURL(c, loadBalancerID)
+	url += v1.IDSliceToQueryString("id", itemIDs)
+
+	_, res.Err = perigee.Request("DELETE", url, perigee.Options{
+		MoreHeaders: c.AuthenticatedHeaders(),
+		OkCodes:     []int{200},
+	})
+
+	return res
+}
