Understanding how REST web services work