make it easier to to customize controllers by providing before()

also start unifying the json output a bit from jsonview