Feature/api DO NOT MERGE

Moving general methods to a new api module.