fixed require
use json instead of generating js in the view
use pstore as cache