Adding logic for Post#as_json