API Controller - Error handling added