working on handle error of post data to api