Move some classes into API-project

Fix #626