500 Internal Server Error

I’ve got this error when I tried to turn on/off a light. It was done successfully, but our server got the 500 error as reponse, like this:

Oh No! Something Went Wrong!
Erro:r 500: Internal Server Error
URI: /api/smartapps/installations/15a852df-a564-4bbb-80c8-888f0dcbca71/switches/off/0
Reference Id: 41d79ba1-bb7b-4bbb-af42-54ec0b4d9c94
Date: Wed Oct 21 21:50:34 UTC 2015

What is the problem?

The following is the server-side code:

Parse.Cloud.define(“turnOffLights”, function(request, response) {
var user = Parse.User.current();
getSmartThingsEndpointURL(user).then(function(httpResponse) {
var json = JSON.parse(httpResponse.text);
var epURL = json[0][“url”];
var endpointURL = “https://graph.api.smartthings.com” + epURL + “/switches/off/0”;
return Parse.Cloud.httpRequest({
url: endpointURL,
headers: {
“Authorization”: "Bearer "+user.get(“tokenSmartThings”)
}).then(function(httpResponse) {
response.success(“successfully turned on lights”);
}, function(error) {