add places api controller. move javascript to a separate file and convert it to coffeescript