adding id and automating json for api