implements back-end logic for index & hotel