Simplified json sending to api endpoint

No need to store tmp file to send it.