Added map to resource detail view
Refactored the search function out to several different functions