Fix failing tests and implified getPin function in Location model