added returnJson method