Improve pulling endpoints out of database