pass errors back to api