If you try to create a device twice, it result in an error 500:
$ TOK=`curl -vvv -X POST "http://172.16.11.187/auth/token" -d "{\"username\":\"admin\",\"password\":\"loragateway\"}" | tr -d '"'`
$ curl -X POST "http://172.16.11.187/devices" -H "accept: text/plain" -H "Content-Type: application/json" -H "Authorization: Bearer $TOK" -d '{"id" : "test"}'
$ curl -X POST "http://172.16.11.187/devices" -H "accept: text/plain" -H "Content-Type: application/json" -H "Authorization: Bearer $TOK" -d '{"id" : "test"}'
HTTP/1.1 500 Internal Server Error