first step to convert the app into a REST API
missed things from last commit
added handler for OPTIONS request sent by Angular
lot of work to REST api