Selecting server data by ajax and modeling queries to html's page