updated to handle JSON POST body instead of params in views