Using Emit function now instead of concatenating json data manually.