Do you mean the REST API is hosted on the APIGateway? If yes, you can also check the logs on the server(API Gateway) side, perhaps the NullPointerException is originating on the server?
Additionally , from the error screenshot , it looks like you are having a pub.flow:getLastError in your flow, can you check the errorDump to see if there is more information?
-NP
#API-Gateway#Integration-Server-and-ESB#webMethods#Service-Designer#API-Management