Returning JSON instead of redirecting on POST requests.