better json API more done in javascript