Refactor API. Still need to change hard coding to config file.