tested api + corrected mistakes there