javascript parsing json solution added. rethinking it