Fix/cleanup api interactions

fixes #2