add tests for api.building, rewrite some methods