finished GET and HEAD functionality