Backend for the St. Andrews university telescope web application