change to api. returns a function now that can also be used to register apis instead of just webapps