Change afterLayergroupCreate signature to take a request parameter

This is currently needed for fetching api_key and username to use
for SQL API query, and can be further extended for other things.