Adding server side code to return a list of patterns