Writing API Unit Testing