vErrors <- lift $ validate e~{show pId} case vErrors of xs@(_:_) -> sendResponseStatus status400 (A.object [ "message" .= ("Entity validation failed" :: Text), "errors" .= toJSON xs ]) _ -> return () ~{maybeBindResult mbv}P.insert (e~{show pId} :: ~{en})