Add function in locationModel, small cleanup in server.js