created posts crud operation with validation