REFACTOR: Using functions from rest-client in avaiabilities page