Wire up the places API and do some refactoring