API implementation: trying to response with app errors