handle server errors
remove redundant functionality
add examples tests