Some api_calls bugfixes and style fixes