tweaking api code