Adding custom API exception