 module.exports = (robot) ->
 
     robot.respond /(metro|wmata)(\s+(.+))?/i, (msg) ->
-        #key = process.env.HUBOT_WMATA_API_KEY
+        key = process.env.HUBOT_WMATA_API_KEY
         if msg.match[3]
             search = msg.match[3]
             # Bus incident search by route name
             if search.match /^(\d\d|\w\d)$/i
-                msg.http("http://api.wmata.com/Incidents.svc/json/BusIncidents?Route=#{search}&api_key=xqv42tjfvz4abb9y9averdvd")
+                msg.http("http://api.wmata.com/Incidents.svc/json/BusIncidents?Route=#{search}&api_key=#{key}")
                 .get() (err, resp, body) ->
                     arr = []
                     results = JSON.parse body

                            s = []
                        for i in results.Entrances
                            if i.StationCode1 not in s
                                msg.http("http://api.wmata.com/Rail.svc/json/jStationInfo?StationCode=#{i.StationCode1}&api_key=xqv42tjfvz4abb9y9averdvd")
                                .get() (err, resp, body) ->
                                    results = JSON.parse body
                                    arr += "#{results.Name}\n"
                                s.push i.StationCode1
                        msg.http("http://api.wmata.com/Bus.svc/json/jStops?lat=#{resp[0].latitude}&lon=#{resp[0].longitude}&radius=200&api_key=xqv42tjfvz4abb9y9averdvd")
                        .get() (err, res, body) ->
                            results = JSON.parse body
                            if results.Stops.length > 0


        # Default to rail delays
        else
            msg.http("http://api.wmata.com/Incidents.svc/json/Incidents?api_key=#{key}")
                .get() (err, resp, body) ->
                    results = JSON.parse body
                    for i in results.Incidents
