MEGA update with working json for all views and Ahmer's code combined with mine