Fixed up API handler to actually be useful