protect API just in case...
refactor some things to prepare for adding database