Improved core and api tests