It seems to me that the implementation would be cleaner (and most restful, though that's not the most important point), if you just broke up these 3 cases into separate endpoint view functions.  Or do you need this aggregated dispatch function for some reason?