moved most notification queries to api