  by #{req.client.remoteAddress}."
                         switch req.method
                             when 'SUBSCRIBE'
-                                # Make sure the callback header exists and at
-                                # least resembles an URL.
+                                # See Device specification for details on errors.
+                                if req.headers.sid and (req.headers.nt or req.headers.callback)
+                                    return callback new HttpError 400
                                 unless /<http/.test req.headers.callback
-                                    return callback new Error('Precondition Failed'), 412
+                                    return callback new HttpError 412
                                 @services[serviceType].event(
                                     req.method.toLowerCase()
                                     req.headers.callback.slice(1, -1)

 at #{req.client.remoteAddress}."
        handler req, (err, data, customHeaders) =>
            if err?
                # On error, `data` is an error code. Very rudimentary error
                # handling, as it is not intended for humans anyway.
                console.warn "Responded with #{data}: #{err.message} for #{req.url}."
                res.writeHead data, 'Content-Type': 'text/plain'
                res.write "#{data} - #{err.message}"
            else
                # Make a header object for response.
                # `null` means use default value.

        switch category
            when 'device'
                if action isnt 'description'
                    return callback new HttpError 404
                @_buildDescription (err, desc) ->
                    return callback new HttpError 500 if err
                    callback null, desc

            when 'service'
