Serverless invoke works but curl does not work

I call an external api from within my lambda function. when i do serverless invoke -f my_func i get the expected response. but if i run a curl command it fails and i get {"message": "Internal server error"}

this is my curl command:

curl -X GET \
  https://0wb3echzu8.execute-api.us-east-1.amazonaws.com/dev/my_func \
  -H 'cache-control: no-cache' \
  -H 'postman-token: bc52ab14-baf4-3f84-5a80-899469cc6596'

this is my code:

var request = require("request");
var options = { method: 'GET',
  url: 'https://api.coinmarketcap.com/v2/listings/',
  headers:
   { 'postman-token': '090e284e-62ad-29f0-0f10-92ae14656a37',
     'cache-control': 'no-cache' } };
module.exports.my_func = (event, context, callback) => {
  request(options, function (error, response, body) {
    if (error) callback(null, error);
    callback(null, body)
  });
};

Can you post the output when you invoke the function using Serverless? it sounds like you’re not sending the correct response from your Lambda for the API gateway.

I have solved it by now. the problem was that i didn’t supply a statusCode to my response.
you can find more info here : https://stackoverflow.com/questions/51799267/serverless-invoke-works-but-curl-gives-error