Drastically enhanced the implementation of Api class