server side logic for the ios app