Getting error 500 when I tried to get record datas using WEB API

Hi Iam trying to get record datas as o/p using creating a WEB API and when I tested in API level am getting the proper record datas as o/p.

But when I tried to tested in the integration and from the postman am getting error 500.

I verified the authentication, added security access even I cant able to get this reason for this issue. 

Can any one help me how to handle this error?, here below I added the code which I used in the WEB API.

a!localVariables(
local!records: queryrecord(
cons!STUDENT_RECORD,
a!query(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 50
)
)
).data,
a!httpResponse(
headers: {
a!httpHeader(
name: "Content-Type",
value: "application/json"
)
},
body: a!toJson(
value: local!records
)
)
)

  Discussion posts and replies are publicly visible