Moved rendering responsibility into the request object so changing output to json for api actions is easy