Implemented getSubscriptions api, fixed a bug