Error control added in endpoints