Fixed state querying api calls; added jquery backup