api rewrite: a bit shorter, a bit prettier, and api keys work