                                 forSession session: Session,
                                 success: ((Session.Waitlist) -> Void)?,
                                 failure: Controller.MethodFailure?) {
-//        var body = Request.Body()
-//        body.add(auth?.currentUser?.customer.id, for: "customer")
-//        body.add(action, for: "action")
-//        
-//        let request = requestBuilder.build(for: .sessionWaitlist(sessionId: session.id),
-//                                           method: .post,
-//                                           contentType: .formUrlEncoded,
-//                                           body: body,
-//                                           authentication: .userToken)
-//        requestExecutor.execute(request: request,
-//                                success:
-//            { (request, response, data) in
-//                guard let data = data else {
-//                    failure?(RequestError.unknown)
-//                    return
-//                }
-//                do {
-//                    let waitlist = try self.decoder.decode(Session.Waitlist.self, from: data)
-//                    success?(waitlist)
-//                } catch {
-//                    failure?(RequestError(with: error))
-//                }
-//        }) { (request, response, error) in
-//            failure?(error)
-//        }
+        
+        
+        var parameters: Alamofire.Parameters = [
+            "action" : action
+        ]
+        if let customerId = auth?.currentUser?.customer.id {
+            parameters["customer"] = customerId
+        }
+        
+        let request = requestBuilder.build(for: .sessionWaitlist(sessionId: session.id),
+                                           method: .post,
+                                           parameters: parameters,
+                                           encoding: URLEncoding.httpBody,
+                                           authentication: .userToken)
+        
+        requestExecutor.execute(request: request,
+                                success:
+            { (request, response, data) in
+                guard let data = data else {
+                    failure?(TeamupError.unknown, nil)
+                    return
+                }
+                do {
+                    let waitlist = try self.decoder.decode(Session.Waitlist.self, from: data)
+                    success?(waitlist)
+                } catch {
+                    failure?(error, nil)
+                }
+        }) { (request, response, error) in
+            failure?(error, response?.errorDetail)
+        }
     }
 }

              success: ((Session.Waitlist) -> Void)?,
              failure: Controller.MethodFailure?) {
        
//        var parameters = Request.Parameters()
//        parameters.set(auth?.currentUser?.customer.id, for: "customer")
//
//        let request = requestBuilder.build(for: .sessionWaitlist(sessionId: session.id),
//                                           method: .get,
//                                           contentType: .json,
//                                           parameters: parameters,
//                                           authentication: .userToken)
//        requestExecutor.execute(request: request,
//                                success:
//            { (request, response, data) in
//                guard let data = data else {
//                    failure?(RequestError.unknown)
//                    return
//                }
//                do {
//                    let waitlist = try self.decoder.decode(Session.Waitlist.self, from: data)
//                    success?(waitlist)
//                } catch {
//                    failure?(RequestError(with: error))
//                }
//        }) { (request, response, error) in
//            failure?(error)
//        }
    }
    
    func join(forSession session: Session,

//

import Foundation
import Alamofire

class WaitlistsApiController: AuthenticatedController, WaitlistsController {
    
