Failed api action returns error message