Fix adds correct usage for fail_json and also adds testcases to verify this. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>