Modified the APIs according to Brian's request and client's
requirements.