add statusCode checking
add exception catching