fixed #1: finish implementing the base state query on the back end