The test in your function won't work - you should not have brackets around the -z clauses, and there should be a space between if and the open bracket. It should read:
function coolness() {
if [ -z "$1" -o -z "$2" ]; then
echo "Usage: $0 [sub_package] [endpoint]";
exit 1;
fi
echo "Hi!"
}