changes to db querying and added retrieval of data using parameters in url