fixed a hidden error.
Api object is now stateless