fix check status code of the response and add some documentations